diff --git a/examples/FaxDelete.cs b/examples/FaxDelete.cs new file mode 100644 index 000000000..88a6ed074 --- /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.FaxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + } + 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..794b74d94 --- /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.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + } 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..38492bd21 --- /dev/null +++ b/examples/FaxDelete.js @@ -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.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + +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..a5c62f5e9 --- /dev/null +++ b/examples/FaxDelete.php @@ -0,0 +1,18 @@ +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +try { + $faxApi->faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); +} 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..adf2a5da8 --- /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.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 new file mode 100644 index 000000000..f68be3440 --- /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.fax_delete("fa5c8a0b0f492d768749333ad6fcc214c111e967") +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..38492bd21 --- /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.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + +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..fbaf4166e --- /dev/null +++ b/examples/FaxFiles.cs @@ -0,0 +1,34 @@ +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 + { + 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) + { + 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..bd6dcc5df --- /dev/null +++ b/examples/FaxFiles.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.*; + +import java.io.File; + +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 { + 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()); + 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..d7390cf60 --- /dev/null +++ b/examples/FaxFiles.js @@ -0,0 +1,17 @@ +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 faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +const result = faxApi.faxFiles(faxId); +result.then(response => { + 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 new file mode 100644 index 000000000..d543eea9c --- /dev/null +++ b/examples/FaxFiles.php @@ -0,0 +1,21 @@ +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +try { + $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: " + . print_r($error->getError()); +} diff --git a/examples/FaxFiles.py b/examples/FaxFiles.py new file mode 100644 index 000000000..110a0f7b5 --- /dev/null +++ b/examples/FaxFiles.py @@ -0,0 +1,19 @@ +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: + 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 new file mode 100644 index 000000000..d867387ad --- /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 + 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 new file mode 100644 index 000000000..02f04e4a1 --- /dev/null +++ b/examples/FaxFiles.sh @@ -0,0 +1,3 @@ +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 new file mode 100644 index 000000000..d7390cf60 --- /dev/null +++ b/examples/FaxFiles.ts @@ -0,0 +1,17 @@ +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 faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +const result = faxApi.faxFiles(faxId); +result.then(response => { + 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 new file mode 100644 index 000000000..6396e0c34 --- /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.FaxGet(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..a9cc433df --- /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.faxGet(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..8a1dbbfda --- /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.faxGet(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..43b7a1f3e --- /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->faxGet($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..c56656833 --- /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) + + fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + + try: + 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 new file mode 100644 index 000000000..64dc1c057 --- /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.fax_get(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..793f6e5d3 --- /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.faxGet(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..f87d9b8f2 --- /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.FaxList(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..042bb7107 --- /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.faxList(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..385f44779 --- /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.faxList(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..d2a513c21 --- /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->faxList($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..6b71f79b6 --- /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.fax_list( + 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..3f37a71ea --- /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.fax_list({ 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..385f44779 --- /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.faxList(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..8e72a4f93 --- /dev/null +++ b/examples/FaxSend.cs @@ -0,0 +1,49 @@ +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 files = new List { + new FileStream( + "./example_fax.pdf", + FileMode.Open, + FileAccess.Read, + FileShare.Read + ) + }; + + var data = new FaxSendRequest( + files: files, + testMode: true, + recipient: "16690000001", + sender: "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.FaxSend(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..4e764da83 --- /dev/null +++ b/examples/FaxSend.java @@ -0,0 +1,37 @@ +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 FaxSendRequest() + .addFilesItem(new File("example_fax.pdf")) + .testMode(true) + .recipient("16690000001") + .sender("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.faxSend(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..4b0eef2da --- /dev/null +++ b/examples/FaxSend.js @@ -0,0 +1,47 @@ +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 = { + files: [ file, fileBuffer, fileBufferAlt ], + testMode: true, + recipient: "16690000001", + sender: "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.faxSend(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..2dd42d386 --- /dev/null +++ b/examples/FaxSend.php @@ -0,0 +1,29 @@ +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$data = new Dropbox\Sign\Model\FaxSendRequest(); +$data->setFiles([new SplFileObject(__DIR__ . "/example_signature_request.pdf")]) + ->setTestMode(true) + ->setRecipient("16690000001") + ->setSender("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->faxSend($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..c24d6ada7 --- /dev/null +++ b/examples/FaxSend.py @@ -0,0 +1,28 @@ +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.FaxSendRequest( + files=[open("example_signature_request.pdf", "rb")], + test_mode=True, + 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!", + ) + + try: + 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 new file mode 100644 index 000000000..c37cbbd10 --- /dev/null +++ b/examples/FaxSend.rb @@ -0,0 +1,25 @@ +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::FaxSendRequest.new +data.files = [File.new("example_signature_request.pdf", "r")] +data.test_mode = true +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" +data.title = "This is what the fax is about!" + +begin + result = fax_api.fax_send(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..7ab64cb31 --- /dev/null +++ b/examples/FaxSend.sh @@ -0,0 +1,10 @@ +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 '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' \ + -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 new file mode 100644 index 000000000..2f3f6e25d --- /dev/null +++ b/examples/FaxSend.ts @@ -0,0 +1,47 @@ +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: 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, + recipient: "16690000001", + sender: "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.faxSend(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/FaxGetResponseExample.json b/examples/json/FaxGetResponseExample.json new file mode 100644 index 000000000..30475f119 --- /dev/null +++ b/examples/json/FaxGetResponseExample.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, + "sender": "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", + } +} \ No newline at end of file diff --git a/examples/json/FaxListResponseExample.json b/examples/json/FaxListResponseExample.json new file mode 100644 index 000000000..bf4f66bcc --- /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, + "sender": "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/examples/json/FaxSendRequestExample.json b/examples/json/FaxSendRequestExample.json new file mode 100644 index 000000000..fe7e68820 --- /dev/null +++ b/examples/json/FaxSendRequestExample.json @@ -0,0 +1,12 @@ +{ + "file_url": [ + "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" + ], + "test_mode": "true", + "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!" +} \ No newline at end of file diff --git a/openapi-raw.yaml b/openapi-raw.yaml index e0d57e123..5489d3bd4 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1403,6 +1403,304 @@ 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: faxGet + 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/FaxGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxGetResponseExample' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: faxDelete + parameters: + - + name: fax_id + in: path + description: '_t__FaxParam::FAX_ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + responses: + '204': + 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' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: faxFiles + 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' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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 +2498,220 @@ 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: faxList + parameters: + - + name: page + in: query + description: '_t__FaxList::PAGE' + schema: + type: integer + default: 1 + minimum: 1 + example: 1 + - + name: page_size + in: query + description: '_t__FaxList::PAGE_SIZE' + schema: + type: integer + default: 20 + 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' + 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: faxSend + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxSendRequest' + examples: + default_example: + $ref: '#/components/examples/FaxSendRequestExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxSendRequest' + 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/FaxGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxGetResponseExample' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: @@ -7285,6 +7797,50 @@ components: type: string format: email type: object + FaxSendRequest: + required: + - recipient + properties: + recipient: + description: '_t__FaxSend::RECIPIENT' + type: string + example: recipient@example.com + sender: + description: '_t__FaxSend::SENDER' + type: string + example: sender@example.com + files: + description: '_t__FaxSend::FILE' + type: array + items: + type: string + format: binary + file_urls: + description: '_t__FaxSend::FILE_URL' + type: array + items: + type: string + test_mode: + description: '_t__FaxSend::TEST_MODE' + type: boolean + default: false + cover_page_to: + description: '_t__FaxSend::COVER_PAGE_TO' + type: string + example: 'Recipient Name' + cover_page_from: + description: '_t__FaxSend::COVER_PAGE_FROM' + type: string + example: 'Sender Name' + cover_page_message: + description: '_t__FaxSend::COVER_PAGE_MESSAGE' + type: string + example: 'Please find the attached documents.' + title: + description: '_t__FaxSend::TITLE' + type: string + example: 'Fax Title' + type: object OAuthTokenGenerateRequest: required: - client_id @@ -9643,6 +10199,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxGetResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponse' + warnings: + description: '_t__WarningResponse::LIST_DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -9678,6 +10247,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/FaxResponse' + list_info: + $ref: '#/components/schemas/ListInfoResponse' + type: object + x-internal-class: true FileResponse: required: - file_url @@ -10057,6 +10639,54 @@ components: description: '_t__ErrorResponseError::ERROR_NAME' type: string type: object + FaxResponse: + required: + - fax_id + - title + - original_title + - subject + - message + - metadata + - created_at + - sender + - transmissions + - files_url + properties: + fax_id: + description: '_t__FaxResponse::FAX_ID' + type: string + title: + description: '_t__FaxResponse::TITLE' + type: string + original_title: + description: '_t__FaxResponse::ORIGINAL_TITLE' + type: string + subject: + description: '_t__FaxResponse::SUBJECT' + type: string + message: + description: '_t__FaxResponse::MESSAGE' + type: string + metadata: + description: '_t__FaxResponse::METADATA' + type: object + additionalProperties: { } + created_at: + description: '_t__FaxResponse::CREATED_AT' + type: integer + sender: + description: '_t__FaxResponse::SENDER' + type: string + transmissions: + description: '_t__FaxResponse::TRANSMISSIONS' + type: array + items: + $ref: '#/components/schemas/FaxResponseTransmission' + files_url: + description: '_t__FaxResponse::FILES_URL' + type: string + type: object + x-internal-class: true FaxLineResponseFaxLine: required: - accounts @@ -10079,6 +10709,35 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true + FaxResponseTransmission: + required: + - recipient + - sender + - status_code + properties: + recipient: + description: '_t__Sub::FaxResponseTransmission::RECIPIENT' + type: string + sender: + description: '_t__Sub::FaxResponseTransmission::SENDER' + type: string + 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 + type: object + x-internal-class: true ListInfoResponse: description: '_t__ListInfoResponse::DESCRIPTION' properties: @@ -11795,6 +12454,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: @@ -12039,6 +12702,10 @@ components: summary: '_t__Error::4XX' value: $ref: examples/json/Error4XXResponseExample.json + FaxGetResponseExample: + summary: '_t__FaxGetResponseExample::SUMMARY' + value: + $ref: examples/json/FaxGetResponseExample.json FaxLineResponseExample: summary: '_t__FaxLineResponseExample::SUMMARY' value: @@ -12051,6 +12718,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 f24937c67..db1c5b203 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1409,6 +1409,304 @@ 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: faxGet + 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/FaxGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxGetResponseExample' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: faxDelete + parameters: + - + name: fax_id + in: path + description: 'Fax ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + responses: + 204: + 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' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: faxFiles + 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' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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 +2504,220 @@ 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: faxList + parameters: + - + name: page + in: query + description: Page + schema: + type: integer + default: 1 + minimum: 1 + example: 1 + - + name: page_size + in: query + description: 'Page size' + schema: + type: integer + default: 20 + 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' + 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: faxSend + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxSendRequest' + examples: + default_example: + $ref: '#/components/examples/FaxSendRequestExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxSendRequest' + 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/FaxGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxGetResponseExample' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: @@ -7379,6 +7891,50 @@ components: type: string format: email type: object + FaxSendRequest: + required: + - recipient + properties: + recipient: + description: 'Fax Send To Recipient' + type: string + example: recipient@example.com + sender: + description: 'Fax Send From Sender (used only with fax number)' + type: string + example: sender@example.com + files: + description: 'Fax File to Send' + type: array + items: + type: string + format: binary + file_urls: + description: 'Fax File URL to Send' + type: array + items: + type: string + test_mode: + description: 'API Test Mode Setting' + type: boolean + default: false + cover_page_to: + description: 'Fax Cover Page for Recipient' + type: string + example: 'Recipient Name' + cover_page_from: + description: 'Fax Cover Page for Sender' + type: string + example: 'Sender Name' + cover_page_message: + description: 'Fax Cover Page Message' + type: string + example: 'Please find the attached documents.' + title: + description: 'Fax Title' + type: string + example: 'Fax Title' + type: object OAuthTokenGenerateRequest: required: - client_id @@ -10251,6 +10807,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxGetResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponse' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -10286,6 +10855,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/FaxResponse' + list_info: + $ref: '#/components/schemas/ListInfoResponse' + type: object + x-internal-class: true FileResponse: required: - file_url @@ -10665,6 +11247,54 @@ components: description: 'Name of the error.' type: string type: object + FaxResponse: + required: + - fax_id + - title + - original_title + - subject + - message + - metadata + - created_at + - sender + - transmissions + - files_url + 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 + additionalProperties: {} + created_at: + description: 'Fax Created At Timestamp' + type: integer + sender: + description: 'Fax Sender Email' + type: string + transmissions: + description: 'Fax Transmissions List' + type: array + items: + $ref: '#/components/schemas/FaxResponseTransmission' + files_url: + description: 'Fax Files URL' + type: string + type: object + x-internal-class: true FaxLineResponseFaxLine: required: - accounts @@ -10687,6 +11317,35 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true + FaxResponseTransmission: + required: + - recipient + - sender + - status_code + properties: + recipient: + description: 'Fax Transmission Recipient' + type: string + sender: + description: 'Fax Transmission Sender' + type: string + 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 + type: object + x-internal-class: true ListInfoResponse: description: 'Contains pagination information about the data returned.' properties: @@ -12587,6 +13246,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: @@ -12831,6 +13494,10 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json + FaxGetResponseExample: + summary: 'Fax Response' + value: + $ref: examples/json/FaxGetResponseExample.json FaxLineResponseExample: summary: 'Sample Fax Line Response' value: @@ -12843,6 +13510,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 56be94ebe..4962a5d25 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1409,6 +1409,304 @@ 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: faxGet + 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/FaxGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxGetResponseExample' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: faxDelete + parameters: + - + name: fax_id + in: path + description: 'Fax ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + responses: + 204: + 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' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: faxFiles + 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' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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 +2504,220 @@ 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: faxList + parameters: + - + name: page + in: query + description: Page + schema: + type: integer + default: 1 + minimum: 1 + example: 1 + - + name: page_size + in: query + description: 'Page size' + schema: + type: integer + default: 20 + 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' + 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: faxSend + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxSendRequest' + examples: + default_example: + $ref: '#/components/examples/FaxSendRequestExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxSendRequest' + 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/FaxGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxGetResponseExample' + 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' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 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: @@ -7379,6 +7891,50 @@ components: type: string format: email type: object + FaxSendRequest: + required: + - recipient + properties: + recipient: + description: 'Fax Send To Recipient' + type: string + example: recipient@example.com + sender: + description: 'Fax Send From Sender (used only with fax number)' + type: string + example: sender@example.com + files: + description: 'Fax File to Send' + type: array + items: + type: string + format: binary + file_urls: + description: 'Fax File URL to Send' + type: array + items: + type: string + test_mode: + description: 'API Test Mode Setting' + type: boolean + default: false + cover_page_to: + description: 'Fax Cover Page for Recipient' + type: string + example: 'Recipient Name' + cover_page_from: + description: 'Fax Cover Page for Sender' + type: string + example: 'Sender Name' + cover_page_message: + description: 'Fax Cover Page Message' + type: string + example: 'Please find the attached documents.' + title: + description: 'Fax Title' + type: string + example: 'Fax Title' + type: object OAuthTokenGenerateRequest: required: - client_id @@ -10229,6 +10785,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxGetResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponse' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -10264,6 +10833,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/FaxResponse' + list_info: + $ref: '#/components/schemas/ListInfoResponse' + type: object + x-internal-class: true FileResponse: required: - file_url @@ -10643,6 +11225,54 @@ components: description: 'Name of the error.' type: string type: object + FaxResponse: + required: + - fax_id + - title + - original_title + - subject + - message + - metadata + - created_at + - sender + - transmissions + - files_url + 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 + additionalProperties: {} + created_at: + description: 'Fax Created At Timestamp' + type: integer + sender: + description: 'Fax Sender Email' + type: string + transmissions: + description: 'Fax Transmissions List' + type: array + items: + $ref: '#/components/schemas/FaxResponseTransmission' + files_url: + description: 'Fax Files URL' + type: string + type: object + x-internal-class: true FaxLineResponseFaxLine: required: - accounts @@ -10665,6 +11295,35 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true + FaxResponseTransmission: + required: + - recipient + - sender + - status_code + properties: + recipient: + description: 'Fax Transmission Recipient' + type: string + sender: + description: 'Fax Transmission Sender' + type: string + 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 + type: object + x-internal-class: true ListInfoResponse: description: 'Contains pagination information about the data returned.' properties: @@ -12565,6 +13224,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: @@ -12809,6 +13472,10 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json + FaxGetResponseExample: + summary: 'Fax Response' + value: + $ref: examples/json/FaxGetResponseExample.json FaxLineResponseExample: summary: 'Sample Fax Line Response' value: @@ -12821,6 +13488,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..a7c0c0edb 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* | [**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 @@ -231,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) @@ -242,6 +248,10 @@ 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.FaxResponseTransmission](docs/FaxResponseTransmission.md) + - [Model.FaxSendRequest](docs/FaxSendRequest.md) - [Model.FileResponse](docs/FileResponse.md) - [Model.FileResponseDataUri](docs/FileResponseDataUri.md) - [Model.ListInfoResponse](docs/ListInfoResponse.md) diff --git a/sdks/dotnet/docs/FaxApi.md b/sdks/dotnet/docs/FaxApi.md new file mode 100644 index 000000000..303d4eff9 --- /dev/null +++ b/sdks/dotnet/docs/FaxApi.md @@ -0,0 +1,489 @@ +# Dropbox.Sign.Api.FaxApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**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 | + + +# **FaxDelete** +> void FaxDelete (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.FaxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + } + 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 FaxDeleteWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Fax + apiInstance.FaxDeleteWithHttpInfo(faxId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxApi.FaxDeleteWithHttpInfo: " + 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 | +|-------------|-------------|------------------| +| **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) + + +# **FaxFiles** +> System.IO.Stream FaxFiles (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 + { + 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) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxFilesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // 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.FaxFilesWithHttpInfo: " + 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) + + +# **FaxGet** +> FaxGetResponse FaxGet (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.FaxGet(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 FaxGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // 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.FaxGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxId** | **string** | Fax ID | | + +### Return type + +[**FaxGetResponse**](FaxGetResponse.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) + + +# **FaxList** +> FaxListResponse FaxList (int? page = null, int? pageSize = null) + +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.FaxList(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 FaxListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Lists Faxes + 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.FaxListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **page** | **int?** | Page | [optional] [default to 1] | +| **pageSize** | **int?** | Page size | [optional] [default to 20] | + +### 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) + + +# **FaxSend** +> FaxGetResponse FaxSend (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 files = new List { + new FileStream( + "./example_fax.pdf", + FileMode.Open, + FileAccess.Read, + FileShare.Read + ) + }; + + var data = new FaxSendRequest( + files: files, + testMode: true, + recipient: "16690000001", + sender: "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.FaxSend(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 FaxSendWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Send Fax + 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.FaxSendWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxSendRequest** | [**FaxSendRequest**](FaxSendRequest.md) | | | + +### Return type + +[**FaxGetResponse**](FaxGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FaxGetResponse.md b/sdks/dotnet/docs/FaxGetResponse.md new file mode 100644 index 000000000..42b82e12c --- /dev/null +++ b/sdks/dotnet/docs/FaxGetResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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 new file mode 100644 index 000000000..1cea1149f --- /dev/null +++ b/sdks/dotnet/docs/FaxListResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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 new file mode 100644 index 000000000..27a06144d --- /dev/null +++ b/sdks/dotnet/docs/FaxResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxResponse + +## 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** | **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 new file mode 100644 index 000000000..c306b85d4 --- /dev/null +++ b/sdks/dotnet/docs/FaxResponseTransmission.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxResponseTransmission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/docs/FaxSendRequest.md b/sdks/dotnet/docs/FaxSendRequest.md new file mode 100644 index 000000000..b02d7f0b8 --- /dev/null +++ b/sdks/dotnet/docs/FaxSendRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxSendRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/Api/FaxApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs new file mode 100644 index 000000000..b9819df28 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs @@ -0,0 +1,1206 @@ +/* + * 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 FaxDelete(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 FaxDeleteWithHttpInfo(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 FaxFiles(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 FaxFilesWithHttpInfo(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. + /// FaxGetResponse + FaxGetResponse FaxGet(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 FaxGetResponse + ApiResponse FaxGetWithHttpInfo(string faxId, int operationIndex = 0); + /// + /// Lists Faxes + /// + /// + /// Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Index associated with the operation. + /// FaxListResponse + FaxListResponse FaxList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + + /// + /// Lists Faxes + /// + /// + /// Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Index associated with the operation. + /// ApiResponse of FaxListResponse + ApiResponse FaxListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + /// + /// Send Fax + /// + /// + /// Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxGetResponse + FaxGetResponse FaxSend(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 FaxGetResponse + ApiResponse FaxSendWithHttpInfo(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 FaxDeleteAsync(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> FaxDeleteWithHttpInfoAsync(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 FaxFilesAsync(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> FaxFilesWithHttpInfoAsync(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 FaxGetResponse + System.Threading.Tasks.Task FaxGetAsync(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 (FaxGetResponse) + System.Threading.Tasks.Task> FaxGetWithHttpInfoAsync(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 (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 FaxListAsync(int? page = default(int?), int? pageSize = default(int?), 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 (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> FaxListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), 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 FaxGetResponse + System.Threading.Tasks.Task FaxSendAsync(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 (FaxGetResponse) + System.Threading.Tasks.Task> FaxSendWithHttpInfoAsync(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 FaxDelete(string faxId, int operationIndex = 0) + { + FaxDeleteWithHttpInfo(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 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->FaxDelete"); + } + + 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.FaxDelete"; + 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("FaxDelete", 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 FaxDeleteAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await FaxDeleteWithHttpInfoAsync(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> 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->FaxDelete"); + } + + + 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.FaxDelete"; + 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("FaxDelete", 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 FaxFiles(string faxId, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxFilesWithHttpInfo(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 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->FaxFiles"); + } + + 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.FaxFiles"; + 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("FaxFiles", 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 FaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxFilesWithHttpInfoAsync(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> 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->FaxFiles"); + } + + + 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.FaxFiles"; + 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("FaxFiles", 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. + /// FaxGetResponse + public FaxGetResponse FaxGet(string faxId, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxGetWithHttpInfo(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 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->FaxGet"); + } + + 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.FaxGet"; + 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("FaxGet", 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 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 FaxGetWithHttpInfoAsync(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 (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->FaxGet"); + } + + + 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.FaxGet"; + 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("FaxGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Lists Faxes Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Index associated with the operation. + /// FaxListResponse + public FaxListResponse FaxList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxListWithHttpInfo(page, pageSize); + return localVarResponse.Data; + } + + /// + /// Lists Faxes Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Index associated with the operation. + /// ApiResponse of FaxListResponse + 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(); + + 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); + } + + 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.FaxList"; + 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("FaxList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Lists Faxes Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// 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 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 FaxListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Lists Faxes Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// 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> 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(); + + 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); + } + + 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.FaxList"; + 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("FaxList", 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. + /// FaxGetResponse + public FaxGetResponse FaxSend(FaxSendRequest faxSendRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxSendWithHttpInfo(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 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->FaxSend"); + } + + 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.FaxSend"; + 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("FaxSend", 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 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 FaxSendWithHttpInfoAsync(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 (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->FaxSend"); + } + + + 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.FaxSend"; + 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("FaxSend", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} 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 new file mode 100644 index 000000000..d5c62990a --- /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..60125d8e1 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs @@ -0,0 +1,443 @@ +/* + * 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 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 sender = 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 "sender" is required (not null) + if (sender == null) + { + throw new ArgumentNullException("sender is a required property for FaxResponse and cannot be null"); + } + this.Sender = sender; + // 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; + } + + /// + /// 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; + } + + /// + /// Fax ID + /// + /// Fax ID + [DataMember(Name = "fax_id", IsRequired = true, EmitDefaultValue = true)] + public string FaxId { get; set; } + + /// + /// Fax Title + /// + /// Fax Title + [DataMember(Name = "title", IsRequired = true, EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Fax Original Title + /// + /// Fax Original Title + [DataMember(Name = "original_title", IsRequired = true, EmitDefaultValue = true)] + public string OriginalTitle { get; set; } + + /// + /// Fax Subject + /// + /// Fax Subject + [DataMember(Name = "subject", IsRequired = true, EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Fax Message + /// + /// Fax Message + [DataMember(Name = "message", IsRequired = true, EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Fax Metadata + /// + /// Fax Metadata + [DataMember(Name = "metadata", IsRequired = true, EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Fax Created At Timestamp + /// + /// Fax Created At Timestamp + [DataMember(Name = "created_at", IsRequired = true, EmitDefaultValue = true)] + public int CreatedAt { get; set; } + + /// + /// Fax Sender Email + /// + /// Fax Sender Email + [DataMember(Name = "sender", IsRequired = true, EmitDefaultValue = true)] + public string Sender { get; set; } + + /// + /// Fax Transmissions List + /// + /// Fax Transmissions List + [DataMember(Name = "transmissions", IsRequired = true, EmitDefaultValue = true)] + public List Transmissions { get; set; } + + /// + /// Fax Files URL + /// + /// Fax Files URL + [DataMember(Name = "files_url", IsRequired = true, 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 FaxResponse {\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(" Sender: ").Append(Sender).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 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.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 && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.CreatedAt == input.CreatedAt || + this.CreatedAt.Equals(input.CreatedAt) + ) && + ( + this.Sender == input.Sender || + (this.Sender != null && + this.Sender.Equals(input.Sender)) + ) && + ( + 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.Sender != null) + { + hashCode = (hashCode * 59) + this.Sender.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 = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "created_at", + Property = "CreatedAt", + Type = "int", + Value = CreatedAt, + }); + types.Add(new OpenApiType() + { + Name = "sender", + Property = "Sender", + Type = "string", + Value = Sender, + }); + 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/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/FaxResponseTransmission.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs new file mode 100644 index 000000000..0e370714e --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs @@ -0,0 +1,302 @@ +/* + * 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 + { + /// + /// 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", IsRequired = true, EmitDefaultValue = true)] + public StatusCodeEnum StatusCode { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxResponseTransmission() { } + /// + /// Initializes a new instance of the class. + /// + /// 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)) + { + + // 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; + } + + /// + /// 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", IsRequired = true, EmitDefaultValue = true)] + public string Recipient { get; set; } + + /// + /// Fax Transmission Sender + /// + /// Fax Transmission Sender + [DataMember(Name = "sender", IsRequired = true, EmitDefaultValue = true)] + public string Sender { 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.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(); + } + 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..e4d42e6d4 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs @@ -0,0 +1,383 @@ +/* + * 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 (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). + /// Fax Cover Page for Recipient. + /// Fax Cover Page for Sender. + /// Fax Cover Page Message. + /// Fax Title. + 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 "recipient" is required (not null) + if (recipient == null) + { + throw new ArgumentNullException("recipient is a required property for FaxSendRequest and cannot be null"); + } + this.Recipient = recipient; + this.Sender = sender; + this.Files = files; + this.FileUrls = fileUrls; + 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 = "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 = "sender", EmitDefaultValue = true)] + public string Sender { get; set; } + + /// + /// Fax File to Send + /// + /// Fax File to Send + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Fax File URL to Send + /// + /// Fax File URL to Send + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// API Test Mode Setting + /// + /// API Test Mode Setting + [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(" 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"); + 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.Recipient == input.Recipient || + (this.Recipient != null && + this.Recipient.Equals(input.Recipient)) + ) && + ( + this.Sender == input.Sender || + (this.Sender != null && + this.Sender.Equals(input.Sender)) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.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.Recipient != null) + { + hashCode = (hashCode * 59) + this.Recipient.GetHashCode(); + } + if (this.Sender != null) + { + hashCode = (hashCode * 59) + this.Sender.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + hashCode = (hashCode * 59) + this.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 = "recipient", + Property = "Recipient", + Type = "string", + Value = Recipient, + }); + types.Add(new OpenApiType() + { + Name = "sender", + Property = "Sender", + Type = "string", + Value = Sender, + }); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "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..f03e09094 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* | [**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 @@ -266,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) @@ -277,6 +283,10 @@ 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) + - [FaxResponseTransmission](docs/FaxResponseTransmission.md) + - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) diff --git a/sdks/java-v1/docs/FaxApi.md b/sdks/java-v1/docs/FaxApi.md new file mode 100644 index 000000000..a3d9baef9 --- /dev/null +++ b/sdks/java-v1/docs/FaxApi.md @@ -0,0 +1,364 @@ +# FaxApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +[**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 + + + +## faxDelete + +> faxDelete(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.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + } 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 | +|-------------|-------------|------------------| +| **204** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + +## faxFiles + +> File faxFiles(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.io.File; + +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 { + 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()); + 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 | - | + + +## faxGet + +> FaxGetResponse faxGet(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.faxGet(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 + +[**FaxGetResponse**](FaxGetResponse.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 | - | + + +## faxList + +> FaxListResponse faxList(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.faxList(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 | [optional] [default to 1] + **pageSize** | **Integer**| Page size | [optional] [default to 20] + +### 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 | - | + + +## faxSend + +> FaxGetResponse faxSend(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 FaxSendRequest() + .addFilesItem(new File("example_fax.pdf")) + .testMode(true) + .recipient("16690000001") + .sender("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.faxSend(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 + +[**FaxGetResponse**](FaxGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json, multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + 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 new file mode 100644 index 000000000..f25379a27 --- /dev/null +++ b/sdks/java-v1/docs/FaxListResponse.md @@ -0,0 +1,15 @@ + + +# FaxListResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `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 new file mode 100644 index 000000000..77ec7eb10 --- /dev/null +++ b/sdks/java-v1/docs/FaxResponse.md @@ -0,0 +1,23 @@ + + +# FaxResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `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 | | +| `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 new file mode 100644 index 000000000..09db223e9 --- /dev/null +++ b/sdks/java-v1/docs/FaxResponseTransmission.md @@ -0,0 +1,32 @@ + + +# FaxResponseTransmission + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `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 | | + + + +## 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 new file mode 100644 index 000000000..5b939a0af --- /dev/null +++ b/sdks/java-v1/docs/FaxSendRequest.md @@ -0,0 +1,22 @@ + + +# FaxSendRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `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 | | +| `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/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..ce101cc84 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -0,0 +1,421 @@ +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.FaxGetResponse; +import com.dropbox.sign.model.FaxListResponse; +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
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void faxDelete(String faxId) throws ApiException { + faxDeleteWithHttpInfo(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
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException( + 400, "Missing the required parameter 'faxId' when calling faxDelete"); + } + + // 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.faxDelete", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + 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 faxFiles(String faxId) throws ApiException { + return faxFilesWithHttpInfo(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 faxFilesWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException( + 400, "Missing the required parameter 'faxId' when calling faxFiles"); + } + + // 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.faxFiles", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * Get Fax. Returns information about fax + * + * @param faxId Fax ID (required) + * @return FaxGetResponse + * @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 FaxGetResponse faxGet(String faxId) throws ApiException { + return faxGetWithHttpInfo(faxId).getData(); + } + + /** + * Get Fax. Returns information about fax + * + * @param faxId Fax ID (required) + * @return ApiResponse<FaxGetResponse> + * @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 faxGetWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException( + 400, "Missing the required parameter 'faxId' when calling faxGet"); + } + + // 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.faxGet", + 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 (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 + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + 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 (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 + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxListWithHttpInfo(Integer page, Integer pageSize) + throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // 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.faxList", + "/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 FaxGetResponse + * @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 FaxGetResponse faxSend(FaxSendRequest faxSendRequest) throws ApiException { + return faxSendWithHttpInfo(faxSendRequest).getData(); + } + + /** + * Send Fax. Action to prepare and send a fax + * + * @param faxSendRequest (required) + * @return ApiResponse<FaxGetResponse> + * @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 faxSendWithHttpInfo(FaxSendRequest faxSendRequest) + throws ApiException { + + // Check required parameters + if (faxSendRequest == null) { + 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", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.faxSend", + "/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/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 new file mode 100644 index 000000000..7da2189b9 --- /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(FaxResponse 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..bbe2dcde4 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.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; + +/** FaxResponse */ +@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_SENDER, + 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_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 Map metadata = new HashMap<>(); + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; + private List transmissions = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + private String filesUrl; + + 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 faxId(String faxId) { + this.faxId = faxId; + return this; + } + + /** + * Fax ID + * + * @return faxId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFaxId() { + return faxId; + } + + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxId(String faxId) { + this.faxId = faxId; + } + + public FaxResponse title(String title) { + this.title = title; + return this; + } + + /** + * Fax Title + * + * @return title + */ + @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.ALWAYS) + 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.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.ALWAYS) + public void setOriginalTitle(String originalTitle) { + this.originalTitle = originalTitle; + } + + public FaxResponse subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Fax Subject + * + * @return subject + */ + @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.ALWAYS) + public void setSubject(String subject) { + this.subject = subject; + } + + public FaxResponse message(String message) { + this.message = message; + return this; + } + + /** + * Fax Message + * + * @return message + */ + @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.ALWAYS) + public void setMessage(String message) { + this.message = message; + } + + 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.Nonnull + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public FaxResponse createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Fax Created At Timestamp + * + * @return createdAt + */ + @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.ALWAYS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + public FaxResponse sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Sender Email + * + * @return sender + */ + @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.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + public FaxResponse transmissions(List transmissions) { + this.transmissions = transmissions; + return this; + } + + public FaxResponse addTransmissionsItem(FaxResponseTransmission transmissionsItem) { + if (this.transmissions == null) { + this.transmissions = new ArrayList<>(); + } + this.transmissions.add(transmissionsItem); + return this; + } + + /** + * Fax Transmissions List + * + * @return transmissions + */ + @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.ALWAYS) + 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.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.ALWAYS) + public void setFilesUrl(String filesUrl) { + this.filesUrl = filesUrl; + } + + /** 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.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.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, + sender, + transmissions, + filesUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponse {\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(" sender: ").append(toIndentedString(sender)).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 (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 (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/FaxResponseTransmission.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java new file mode 100644 index 000000000..8ab92887f --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -0,0 +1,360 @@ +/* + * 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.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; +import java.util.Objects; + +/** FaxResponseTransmission */ +@JsonPropertyOrder({ + 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 FaxResponseTransmission { + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + private String recipient; + + 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 StatusCodeEnum statusCode; + + public static final String JSON_PROPERTY_SENT_AT = "sent_at"; + private Integer sentAt; + + public FaxResponseTransmission() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxResponseTransmission init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseTransmission.class); + } + + public static FaxResponseTransmission init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), FaxResponseTransmission.class); + } + + public FaxResponseTransmission recipient(String recipient) { + this.recipient = recipient; + return this; + } + + /** + * Fax Transmission Recipient + * + * @return recipient + */ + @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.ALWAYS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + public FaxResponseTransmission sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Transmission Sender + * + * @return sender + */ + @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.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + public FaxResponseTransmission statusCode(StatusCodeEnum statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Fax Transmission Status Code + * + * @return statusCode + */ + @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.ALWAYS) + public void setStatusCode(StatusCodeEnum statusCode) { + this.statusCode = statusCode; + } + + public FaxResponseTransmission 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 FaxResponseTransmission object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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 + public int hashCode() { + return Objects.hash(recipient, sender, statusCode, sentAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + 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"); + 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..571ba92f8 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxSendRequest.java @@ -0,0 +1,576 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.dropbox.sign.model; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** FaxSendRequest */ +@JsonPropertyOrder({ + FaxSendRequest.JSON_PROPERTY_RECIPIENT, + FaxSendRequest.JSON_PROPERTY_SENDER, + 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, + 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_RECIPIENT = "recipient"; + private String recipient; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + 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 recipient(String recipient) { + this.recipient = recipient; + return this; + } + + /** + * Fax Send To Recipient + * + * @return recipient + */ + @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.ALWAYS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + public FaxSendRequest sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Send From Sender (used only with fax number) + * + * @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 FaxSendRequest files(List files) { + this.files = files; + return this; + } + + public FaxSendRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Fax File to Send + * + * @return files + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + public FaxSendRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public FaxSendRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Fax File URL to Send + * + * @return fileUrls + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + public 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.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) + && 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( + recipient, + sender, + files, + fileUrls, + testMode, + coverPageTo, + coverPageFrom, + coverPageMessage, + title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxSendRequest {\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"); + 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 (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 (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (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/README.md b/sdks/java-v2/README.md index 75edf1dcb..ea6944786 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* | [**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 @@ -242,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) @@ -253,6 +259,10 @@ 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) + - [FaxResponseTransmission](docs/FaxResponseTransmission.md) + - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) diff --git a/sdks/java-v2/docs/FaxApi.md b/sdks/java-v2/docs/FaxApi.md new file mode 100644 index 000000000..a3d9baef9 --- /dev/null +++ b/sdks/java-v2/docs/FaxApi.md @@ -0,0 +1,364 @@ +# FaxApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +[**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 + + + +## faxDelete + +> faxDelete(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.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + } 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 | +|-------------|-------------|------------------| +| **204** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + +## faxFiles + +> File faxFiles(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.io.File; + +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 { + 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()); + 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 | - | + + +## faxGet + +> FaxGetResponse faxGet(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.faxGet(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 + +[**FaxGetResponse**](FaxGetResponse.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 | - | + + +## faxList + +> FaxListResponse faxList(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.faxList(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 | [optional] [default to 1] + **pageSize** | **Integer**| Page size | [optional] [default to 20] + +### 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 | - | + + +## faxSend + +> FaxGetResponse faxSend(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 FaxSendRequest() + .addFilesItem(new File("example_fax.pdf")) + .testMode(true) + .recipient("16690000001") + .sender("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.faxSend(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 + +[**FaxGetResponse**](FaxGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json, multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + 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 new file mode 100644 index 000000000..f25379a27 --- /dev/null +++ b/sdks/java-v2/docs/FaxListResponse.md @@ -0,0 +1,15 @@ + + +# FaxListResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `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 new file mode 100644 index 000000000..77ec7eb10 --- /dev/null +++ b/sdks/java-v2/docs/FaxResponse.md @@ -0,0 +1,23 @@ + + +# FaxResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `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 | | +| `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 new file mode 100644 index 000000000..09db223e9 --- /dev/null +++ b/sdks/java-v2/docs/FaxResponseTransmission.md @@ -0,0 +1,32 @@ + + +# FaxResponseTransmission + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `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 | | + + + +## 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 new file mode 100644 index 000000000..5b939a0af --- /dev/null +++ b/sdks/java-v2/docs/FaxSendRequest.md @@ -0,0 +1,22 @@ + + +# FaxSendRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `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 | | +| `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/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..e010c8323 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -0,0 +1,416 @@ +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.FaxGetResponse; +import com.dropbox.sign.model.FaxListResponse; +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
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void faxDelete(String faxId) throws ApiException { + faxDeleteWithHttpInfo(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
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxDelete"); + } + + // 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.faxDelete", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + 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 faxFiles(String faxId) throws ApiException { + return faxFilesWithHttpInfo(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 faxFilesWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxFiles"); + } + + // 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.faxFiles", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Get Fax. + * Returns information about fax + * @param faxId Fax ID (required) + * @return FaxGetResponse + * @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 FaxGetResponse faxGet(String faxId) throws ApiException { + return faxGetWithHttpInfo(faxId).getData(); + } + + + /** + * Get Fax. + * Returns information about fax + * @param faxId Fax ID (required) + * @return ApiResponse<FaxGetResponse> + * @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 faxGetWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxGet"); + } + + // 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.faxGet", + 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 (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 + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + 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 (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 + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxListWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // 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.faxList", + "/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 FaxGetResponse + * @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 FaxGetResponse faxSend(FaxSendRequest faxSendRequest) throws ApiException { + return faxSendWithHttpInfo(faxSendRequest).getData(); + } + + + /** + * Send Fax. + * Action to prepare and send a fax + * @param faxSendRequest (required) + * @return ApiResponse<FaxGetResponse> + * @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 faxSendWithHttpInfo(FaxSendRequest faxSendRequest) throws ApiException { + + // Check required parameters + if (faxSendRequest == null) { + 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", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.faxSend", + "/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/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 new file mode 100644 index 000000000..13c0d94e3 --- /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.FaxResponse; +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(FaxResponse 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..35f4ffc6a --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -0,0 +1,649 @@ +/* + * 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.FaxResponseTransmission; +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.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxResponse + */ +@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_SENDER, + 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_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 Map metadata = new HashMap<>(); + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; + private List transmissions = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + private String filesUrl; + + 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 faxId(String faxId) { + this.faxId = faxId; + return this; + } + + /** + * Fax ID + * @return faxId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFaxId() { + return faxId; + } + + + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxId(String faxId) { + this.faxId = faxId; + } + + + public FaxResponse title(String title) { + this.title = title; + return this; + } + + /** + * Fax Title + * @return title + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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.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.ALWAYS) + public void setOriginalTitle(String originalTitle) { + this.originalTitle = originalTitle; + } + + + public FaxResponse subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Fax Subject + * @return subject + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public FaxResponse message(String message) { + this.message = message; + return this; + } + + /** + * Fax Message + * @return message + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(String message) { + this.message = message; + } + + + 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.Nonnull + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public FaxResponse createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Fax Created At Timestamp + * @return createdAt + */ + @jakarta.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.ALWAYS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + + public FaxResponse sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Sender Email + * @return sender + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + + public FaxResponse transmissions(List transmissions) { + this.transmissions = transmissions; + return this; + } + + public FaxResponse addTransmissionsItem(FaxResponseTransmission transmissionsItem) { + if (this.transmissions == null) { + this.transmissions = new ArrayList<>(); + } + this.transmissions.add(transmissionsItem); + return this; + } + + /** + * Fax Transmissions List + * @return transmissions + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTransmissions() { + return transmissions; + } + + + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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.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.ALWAYS) + public void setFilesUrl(String filesUrl) { + this.filesUrl = filesUrl; + } + + + /** + * 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.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.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, sender, transmissions, filesUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponse {\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(" sender: ").append(toIndentedString(sender)).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 (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 (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/FaxResponseTransmission.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java new file mode 100644 index 000000000..dc7bb06a4 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -0,0 +1,375 @@ +/* + * 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; +/** + * FaxResponseTransmission + */ +@JsonPropertyOrder({ + 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 FaxResponseTransmission { + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + private String recipient; + + 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 StatusCodeEnum statusCode; + + public static final String JSON_PROPERTY_SENT_AT = "sent_at"; + private Integer sentAt; + + public FaxResponseTransmission() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxResponseTransmission init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseTransmission.class); + } + + static public FaxResponseTransmission init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxResponseTransmission.class + ); + } + + public FaxResponseTransmission recipient(String recipient) { + this.recipient = recipient; + return this; + } + + /** + * Fax Transmission Recipient + * @return recipient + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRecipient() { + return recipient; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + + public FaxResponseTransmission sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Transmission Sender + * @return sender + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + + public FaxResponseTransmission statusCode(StatusCodeEnum statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Fax Transmission Status Code + * @return statusCode + */ + @jakarta.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.ALWAYS) + public void setStatusCode(StatusCodeEnum statusCode) { + this.statusCode = statusCode; + } + + + public FaxResponseTransmission 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 FaxResponseTransmission object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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 + public int hashCode() { + return Objects.hash(recipient, sender, statusCode, sentAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + 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"); + 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..bb4a6e8a1 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxSendRequest.java @@ -0,0 +1,597 @@ +/* + * 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.io.File; +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_RECIPIENT, + FaxSendRequest.JSON_PROPERTY_SENDER, + 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, + 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_RECIPIENT = "recipient"; + private String recipient; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + 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 recipient(String recipient) { + this.recipient = recipient; + return this; + } + + /** + * Fax Send To Recipient + * @return recipient + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRecipient() { + return recipient; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + + public FaxSendRequest sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Send From Sender (used only with fax number) + * @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 FaxSendRequest files(List files) { + this.files = files; + return this; + } + + public FaxSendRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Fax File to Send + * @return files + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + + public FaxSendRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public FaxSendRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Fax File URL to Send + * @return fileUrls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + + public 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.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) && + 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(recipient, sender, files, fileUrls, testMode, coverPageTo, coverPageFrom, coverPageMessage, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxSendRequest {\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"); + 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 (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 (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (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/node/README.md b/sdks/node/README.md index 4aca5d208..edacf04ad 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* | [**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 | @@ -208,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) @@ -219,6 +225,10 @@ 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) +- [FaxResponseTransmission](./docs/model/FaxResponseTransmission.md) +- [FaxSendRequest](./docs/model/FaxSendRequest.md) - [FileResponse](./docs/model/FileResponse.md) - [FileResponseDataUri](./docs/model/FileResponseDataUri.md) - [ListInfoResponse](./docs/model/ListInfoResponse.md) diff --git a/sdks/node/api/faxApi.ts b/sdks/node/api/faxApi.ts new file mode 100644 index 000000000..dd9c6df2a --- /dev/null +++ b/sdks/node/api/faxApi.ts @@ -0,0 +1,779 @@ +/** + * 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, + FaxGetResponse, + FaxListResponse, + 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 faxDelete( + 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 faxDelete." + ); + } + + (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 list of fax files + * @summary List Fax Files + * @param faxId Fax ID + * @param options + */ + public async faxFiles( + 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 faxFiles." + ); + } + + (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 information about fax + * @summary Get Fax + * @param faxId Fax ID + * @param options + */ + public async faxGet( + 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 faxGet." + ); + } + + (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, + "FaxGetResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxGetResponse" + ) + ) { + 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 faxList( + 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; + + 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 faxSend( + 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 faxSend." + ); + } + + (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, + "FaxGetResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxGetResponse" + ) + ) { + 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 27094d35b..74d7dd106 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -12976,6 +12976,8 @@ __export(api_exports, { EventCallbackRequest: () => EventCallbackRequest, EventCallbackRequestEvent: () => EventCallbackRequestEvent, EventCallbackRequestEventMetadata: () => EventCallbackRequestEventMetadata, + FaxApi: () => FaxApi, + FaxGetResponse: () => FaxGetResponse, FaxLineAddUserRequest: () => FaxLineAddUserRequest, FaxLineApi: () => FaxLineApi, FaxLineAreaCodeGetCountryEnum: () => FaxLineAreaCodeGetCountryEnum, @@ -12988,6 +12990,10 @@ __export(api_exports, { FaxLineRemoveUserRequest: () => FaxLineRemoveUserRequest, FaxLineResponse: () => FaxLineResponse, FaxLineResponseFaxLine: () => FaxLineResponseFaxLine, + FaxListResponse: () => FaxListResponse, + FaxResponse: () => FaxResponse, + FaxResponseTransmission: () => FaxResponseTransmission, + FaxSendRequest: () => FaxSendRequest, FileResponse: () => FileResponse, FileResponseDataUri: () => FileResponseDataUri, HttpBasicAuth: () => HttpBasicAuth, @@ -17692,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() { @@ -17999,6 +18029,203 @@ 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: "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: "{ [key: string]: any; }" + }, + { + name: "createdAt", + baseName: "created_at", + type: "number" + }, + { + name: "sender", + baseName: "sender", + type: "string" + }, + { + name: "transmissions", + baseName: "transmissions", + type: "Array" + }, + { + name: "filesUrl", + baseName: "files_url", + type: "string" + } +]; + +// model/faxResponseTransmission.ts +var _FaxResponseTransmission = class { + static getAttributeTypeMap() { + return _FaxResponseTransmission.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxResponseTransmission"); + } +}; +var FaxResponseTransmission = _FaxResponseTransmission; +FaxResponseTransmission.discriminator = void 0; +FaxResponseTransmission.attributeTypeMap = [ + { + name: "recipient", + baseName: "recipient", + type: "string" + }, + { + name: "sender", + baseName: "sender", + type: "string" + }, + { + name: "statusCode", + baseName: "status_code", + type: "FaxResponseTransmission.StatusCodeEnum" + }, + { + name: "sentAt", + baseName: "sent_at", + 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 { + constructor() { + this["testMode"] = false; + } + static getAttributeTypeMap() { + return _FaxSendRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxSendRequest"); + } +}; +var FaxSendRequest = _FaxSendRequest; +FaxSendRequest.discriminator = void 0; +FaxSendRequest.attributeTypeMap = [ + { + name: "recipient", + baseName: "recipient", + type: "string" + }, + { + name: "sender", + baseName: "sender", + type: "string" + }, + { + name: "files", + baseName: "files", + type: "Array" + }, + { + name: "fileUrls", + baseName: "file_urls", + 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() { @@ -24462,6 +24689,7 @@ var enumsMap = { FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetStateEnum, "FaxLineCreateRequest.CountryEnum": FaxLineCreateRequest.CountryEnum, + "FaxResponseTransmission.StatusCodeEnum": FaxResponseTransmission.StatusCodeEnum, "ReportCreateRequest.ReportTypeEnum": ReportCreateRequest.ReportTypeEnum, "ReportResponse.ReportTypeEnum": ReportResponse.ReportTypeEnum, SignatureRequestResponseCustomFieldTypeEnum, @@ -24524,6 +24752,7 @@ var typeMap = { EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetResponse, FaxLineCreateRequest, @@ -24532,6 +24761,10 @@ var typeMap = { FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, + FaxListResponse, + FaxResponse, + FaxResponseTransmission, + FaxSendRequest, FileResponse, FileResponseDataUri, ListInfoResponse, @@ -26392,9 +26625,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 }; @@ -26442,13 +26675,12 @@ var FaxLineApi = class { addInterceptor(interceptor) { this.interceptors.push(interceptor); } - faxLineAddUser(_0) { - return __async(this, arguments, function* (faxLineAddUserRequest, options = { headers: {} }) { - faxLineAddUserRequest = deserializeIfNeeded4( - faxLineAddUserRequest, - "FaxLineAddUserRequest" + faxDelete(_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( {}, @@ -26462,39 +26694,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 faxDelete." ); } 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) { @@ -26515,26 +26730,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, @@ -26550,15 +26752,18 @@ 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"; + faxFiles(_0) { + return __async(this, arguments, function* (faxId, options = { headers: {} }) { + const localVarPath = this.basePath + "/fax/files/{fax_id}".replace( + "{fax_id}", + encodeURIComponent(String(faxId)) + ); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, this._defaultHeaders ); - const produces = ["application/json"]; + const produces = ["application/pdf", "application/json"]; if (produces.indexOf("application/json") >= 0) { localVarHeaderParams["content-type"] = "application/json"; } else { @@ -26566,33 +26771,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 faxFiles." ); } Object.assign(localVarHeaderParams, options.headers); @@ -26605,7 +26786,7 @@ var FaxLineApi = 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) { @@ -26623,49 +26804,641 @@ 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, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); + 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); + } + ); + }); + }); + }); + } + faxGet(_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( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams = {}; + let localVarBodyParams = void 0; + if (faxId === null || faxId === void 0) { + throw new Error( + "Required parameter faxId was null or undefined when calling faxGet." + ); + } + 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, + "FaxGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxGetResponse" + )) { + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + faxList(_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 !== 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); + } + ); + }); + }); + }); + } + faxSend(_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 faxSend." + ); + } + 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, + "FaxGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxGetResponse" + )) { + 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" + )) { + return; + } + reject(error); + } + ); + } + ); }); }); } faxLineCreate(_0) { return __async(this, arguments, function* (faxLineCreateRequest, options = { headers: {} }) { - faxLineCreateRequest = deserializeIfNeeded4( + faxLineCreateRequest = deserializeIfNeeded5( faxLineCreateRequest, "FaxLineCreateRequest" ); @@ -26736,7 +27509,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -26748,7 +27521,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -26756,7 +27529,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -26773,7 +27546,7 @@ var FaxLineApi = class { } faxLineDelete(_0) { return __async(this, arguments, function* (faxLineDeleteRequest, options = { headers: {} }) { - faxLineDeleteRequest = deserializeIfNeeded4( + faxLineDeleteRequest = deserializeIfNeeded5( faxLineDeleteRequest, "FaxLineDeleteRequest" ); @@ -26844,14 +27617,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", @@ -26924,7 +27697,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -26936,7 +27709,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -26944,7 +27717,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -27031,7 +27804,7 @@ var FaxLineApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -27043,7 +27816,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -27051,7 +27824,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -27069,7 +27842,7 @@ var FaxLineApi = class { } faxLineRemoveUser(_0) { return __async(this, arguments, function* (faxLineRemoveUserRequest, options = { headers: {} }) { - faxLineRemoveUserRequest = deserializeIfNeeded4( + faxLineRemoveUserRequest = deserializeIfNeeded5( faxLineRemoveUserRequest, "FaxLineRemoveUserRequest" ); @@ -27140,7 +27913,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -27152,7 +27925,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -27160,7 +27933,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -27176,13 +27949,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) { @@ -27193,7 +27966,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; } @@ -27201,7 +27974,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) { @@ -27213,10 +27986,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 = { @@ -27264,7 +28037,7 @@ var OAuthApi = class { } oauthTokenGenerate(_0) { return __async(this, arguments, function* (oAuthTokenGenerateRequest, options = { headers: {} }) { - oAuthTokenGenerateRequest = deserializeIfNeeded5( + oAuthTokenGenerateRequest = deserializeIfNeeded6( oAuthTokenGenerateRequest, "OAuthTokenGenerateRequest" ); @@ -27330,7 +28103,7 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -27342,7 +28115,7 @@ var OAuthApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -27350,7 +28123,7 @@ var OAuthApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -27367,7 +28140,7 @@ var OAuthApi = class { } oauthTokenRefresh(_0) { return __async(this, arguments, function* (oAuthTokenRefreshRequest, options = { headers: {} }) { - oAuthTokenRefreshRequest = deserializeIfNeeded5( + oAuthTokenRefreshRequest = deserializeIfNeeded6( oAuthTokenRefreshRequest, "OAuthTokenRefreshRequest" ); @@ -27433,7 +28206,7 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -27445,7 +28218,7 @@ var OAuthApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -27453,7 +28226,7 @@ var OAuthApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -27469,13 +28242,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) { @@ -27486,7 +28259,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; } @@ -27494,7 +28267,7 @@ function handleErrorCodeResponse6(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) { @@ -27506,10 +28279,10 @@ function handleErrorRangeResponse6(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 = { @@ -27557,7 +28330,7 @@ var ReportApi = class { } reportCreate(_0) { return __async(this, arguments, function* (reportCreateRequest, options = { headers: {} }) { - reportCreateRequest = deserializeIfNeeded6( + reportCreateRequest = deserializeIfNeeded7( reportCreateRequest, "ReportCreateRequest" ); @@ -27629,7 +28402,7 @@ var ReportApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse7( + handleSuccessfulResponse8( resolve, reject, response, @@ -27641,7 +28414,7 @@ var ReportApi = class { reject(error); return; } - if (handleErrorCodeResponse7( + if (handleErrorCodeResponse8( reject, error.response, 200, @@ -27649,7 +28422,7 @@ var ReportApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -27666,13 +28439,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) { @@ -27683,7 +28456,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; } @@ -27691,7 +28464,7 @@ function handleErrorCodeResponse7(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse7(reject, response, code, returnType) { +function handleErrorRangeResponse8(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -27703,10 +28476,10 @@ function handleErrorRangeResponse7(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 = { @@ -27754,7 +28527,7 @@ var SignatureRequestApi = class { } signatureRequestBulkCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestBulkCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded7( + signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( signatureRequestBulkCreateEmbeddedWithTemplateRequest, "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" ); @@ -27826,7 +28599,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -27838,7 +28611,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -27846,7 +28619,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -27864,7 +28637,7 @@ var SignatureRequestApi = class { } signatureRequestBulkSendWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestBulkSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded7( + signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded8( signatureRequestBulkSendWithTemplateRequest, "SignatureRequestBulkSendWithTemplateRequest" ); @@ -27941,7 +28714,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -27953,7 +28726,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -27961,7 +28734,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28037,14 +28810,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 (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28061,7 +28834,7 @@ var SignatureRequestApi = class { } signatureRequestCreateEmbedded(_0) { return __async(this, arguments, function* (signatureRequestCreateEmbeddedRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedRequest = deserializeIfNeeded7( + signatureRequestCreateEmbeddedRequest = deserializeIfNeeded8( signatureRequestCreateEmbeddedRequest, "SignatureRequestCreateEmbeddedRequest" ); @@ -28138,7 +28911,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28150,7 +28923,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28158,7 +28931,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28176,7 +28949,7 @@ var SignatureRequestApi = class { } signatureRequestCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded7( + signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( signatureRequestCreateEmbeddedWithTemplateRequest, "SignatureRequestCreateEmbeddedWithTemplateRequest" ); @@ -28253,7 +29026,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28265,7 +29038,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28273,7 +29046,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28355,7 +29128,7 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28367,7 +29140,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28375,7 +29148,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28451,7 +29224,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28463,7 +29236,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28471,7 +29244,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28553,7 +29326,7 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28565,7 +29338,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28573,7 +29346,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28649,7 +29422,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28661,7 +29434,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28669,7 +29442,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28762,7 +29535,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28774,7 +29547,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28782,7 +29555,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28859,7 +29632,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28871,7 +29644,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28879,7 +29652,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28897,7 +29670,7 @@ var SignatureRequestApi = class { } signatureRequestRemind(_0, _1) { return __async(this, arguments, function* (signatureRequestId, signatureRequestRemindRequest, options = { headers: {} }) { - signatureRequestRemindRequest = deserializeIfNeeded7( + signatureRequestRemindRequest = deserializeIfNeeded8( signatureRequestRemindRequest, "SignatureRequestRemindRequest" ); @@ -28982,7 +29755,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28994,7 +29767,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29002,7 +29775,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29073,14 +29846,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 (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29097,7 +29870,7 @@ var SignatureRequestApi = class { } signatureRequestSend(_0) { return __async(this, arguments, function* (signatureRequestSendRequest, options = { headers: {} }) { - signatureRequestSendRequest = deserializeIfNeeded7( + signatureRequestSendRequest = deserializeIfNeeded8( signatureRequestSendRequest, "SignatureRequestSendRequest" ); @@ -29174,7 +29947,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29186,7 +29959,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29194,7 +29967,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29212,7 +29985,7 @@ var SignatureRequestApi = class { } signatureRequestSendWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestSendWithTemplateRequest = deserializeIfNeeded7( + signatureRequestSendWithTemplateRequest = deserializeIfNeeded8( signatureRequestSendWithTemplateRequest, "SignatureRequestSendWithTemplateRequest" ); @@ -29289,7 +30062,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29301,7 +30074,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29309,7 +30082,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29327,7 +30100,7 @@ var SignatureRequestApi = class { } signatureRequestUpdate(_0, _1) { return __async(this, arguments, function* (signatureRequestId, signatureRequestUpdateRequest, options = { headers: {} }) { - signatureRequestUpdateRequest = deserializeIfNeeded7( + signatureRequestUpdateRequest = deserializeIfNeeded8( signatureRequestUpdateRequest, "SignatureRequestUpdateRequest" ); @@ -29412,7 +30185,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29424,7 +30197,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29432,7 +30205,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29449,13 +30222,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) { @@ -29466,7 +30239,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; } @@ -29474,7 +30247,7 @@ function handleErrorCodeResponse8(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) { @@ -29486,10 +30259,10 @@ function handleErrorRangeResponse8(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 = { @@ -29537,7 +30310,7 @@ var TeamApi = class { } teamAddMember(_0, _1) { return __async(this, arguments, function* (teamAddMemberRequest, teamId, options = { headers: {} }) { - teamAddMemberRequest = deserializeIfNeeded8( + teamAddMemberRequest = deserializeIfNeeded9( teamAddMemberRequest, "TeamAddMemberRequest" ); @@ -29619,7 +30392,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29631,7 +30404,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29639,7 +30412,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -29656,7 +30429,7 @@ var TeamApi = class { } teamCreate(_0) { return __async(this, arguments, function* (teamCreateRequest, options = { headers: {} }) { - teamCreateRequest = deserializeIfNeeded8( + teamCreateRequest = deserializeIfNeeded9( teamCreateRequest, "TeamCreateRequest" ); @@ -29729,7 +30502,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29741,7 +30514,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29749,7 +30522,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -29816,14 +30589,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 (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -29890,7 +30663,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29902,7 +30675,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29910,7 +30683,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -29984,7 +30757,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29996,7 +30769,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30004,7 +30777,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30079,7 +30852,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30091,7 +30864,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30099,7 +30872,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30188,7 +30961,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30200,7 +30973,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30208,7 +30981,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30226,7 +30999,7 @@ var TeamApi = class { } teamRemoveMember(_0) { return __async(this, arguments, function* (teamRemoveMemberRequest, options = { headers: {} }) { - teamRemoveMemberRequest = deserializeIfNeeded8( + teamRemoveMemberRequest = deserializeIfNeeded9( teamRemoveMemberRequest, "TeamRemoveMemberRequest" ); @@ -30302,7 +31075,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30314,7 +31087,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 201, @@ -30322,7 +31095,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30410,7 +31183,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30422,7 +31195,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30430,7 +31203,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30448,7 +31221,7 @@ var TeamApi = class { } teamUpdate(_0) { return __async(this, arguments, function* (teamUpdateRequest, options = { headers: {} }) { - teamUpdateRequest = deserializeIfNeeded8( + teamUpdateRequest = deserializeIfNeeded9( teamUpdateRequest, "TeamUpdateRequest" ); @@ -30521,7 +31294,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30533,7 +31306,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30541,7 +31314,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30557,13 +31330,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) { @@ -30574,7 +31347,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; } @@ -30582,7 +31355,7 @@ function handleErrorCodeResponse9(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) { @@ -30594,10 +31367,10 @@ function handleErrorRangeResponse9(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 = { @@ -30645,7 +31418,7 @@ var TemplateApi = class { } templateAddUser(_0, _1) { return __async(this, arguments, function* (templateId, templateAddUserRequest, options = { headers: {} }) { - templateAddUserRequest = deserializeIfNeeded9( + templateAddUserRequest = deserializeIfNeeded10( templateAddUserRequest, "TemplateAddUserRequest" ); @@ -30730,7 +31503,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30742,7 +31515,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30750,7 +31523,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -30768,7 +31541,7 @@ var TemplateApi = class { } templateCreate(_0) { return __async(this, arguments, function* (templateCreateRequest, options = { headers: {} }) { - templateCreateRequest = deserializeIfNeeded9( + templateCreateRequest = deserializeIfNeeded10( templateCreateRequest, "TemplateCreateRequest" ); @@ -30845,7 +31618,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30857,7 +31630,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30865,7 +31638,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -30883,7 +31656,7 @@ var TemplateApi = class { } templateCreateEmbeddedDraft(_0) { return __async(this, arguments, function* (templateCreateEmbeddedDraftRequest, options = { headers: {} }) { - templateCreateEmbeddedDraftRequest = deserializeIfNeeded9( + templateCreateEmbeddedDraftRequest = deserializeIfNeeded10( templateCreateEmbeddedDraftRequest, "TemplateCreateEmbeddedDraftRequest" ); @@ -30960,7 +31733,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30972,7 +31745,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30980,7 +31753,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31056,14 +31829,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 (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31144,7 +31917,7 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31156,7 +31929,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31164,7 +31937,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31240,7 +32013,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31252,7 +32025,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31260,7 +32033,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31342,7 +32115,7 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31354,7 +32127,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31362,7 +32135,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31438,7 +32211,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31450,7 +32223,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31458,7 +32231,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31551,7 +32324,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31563,7 +32336,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31571,7 +32344,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31589,7 +32362,7 @@ var TemplateApi = class { } templateRemoveUser(_0, _1) { return __async(this, arguments, function* (templateId, templateRemoveUserRequest, options = { headers: {} }) { - templateRemoveUserRequest = deserializeIfNeeded9( + templateRemoveUserRequest = deserializeIfNeeded10( templateRemoveUserRequest, "TemplateRemoveUserRequest" ); @@ -31674,7 +32447,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31686,7 +32459,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31694,7 +32467,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31712,7 +32485,7 @@ var TemplateApi = class { } templateUpdateFiles(_0, _1) { return __async(this, arguments, function* (templateId, templateUpdateFilesRequest, options = { headers: {} }) { - templateUpdateFilesRequest = deserializeIfNeeded9( + templateUpdateFilesRequest = deserializeIfNeeded10( templateUpdateFilesRequest, "TemplateUpdateFilesRequest" ); @@ -31797,7 +32570,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31809,7 +32582,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31817,7 +32590,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31834,13 +32607,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) { @@ -31851,7 +32624,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; } @@ -31859,7 +32632,7 @@ function handleErrorCodeResponse10(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) { @@ -31871,10 +32644,10 @@ function handleErrorRangeResponse10(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 = { @@ -31922,7 +32695,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreate(_0) { return __async(this, arguments, function* (unclaimedDraftCreateRequest, options = { headers: {} }) { - unclaimedDraftCreateRequest = deserializeIfNeeded10( + unclaimedDraftCreateRequest = deserializeIfNeeded11( unclaimedDraftCreateRequest, "UnclaimedDraftCreateRequest" ); @@ -31999,7 +32772,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32011,7 +32784,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32019,7 +32792,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -32037,7 +32810,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreateEmbedded(_0) { return __async(this, arguments, function* (unclaimedDraftCreateEmbeddedRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded10( + unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded11( unclaimedDraftCreateEmbeddedRequest, "UnclaimedDraftCreateEmbeddedRequest" ); @@ -32114,7 +32887,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32126,7 +32899,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32134,7 +32907,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -32152,7 +32925,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (unclaimedDraftCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded10( + unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded11( unclaimedDraftCreateEmbeddedWithTemplateRequest, "UnclaimedDraftCreateEmbeddedWithTemplateRequest" ); @@ -32229,7 +33002,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32241,7 +33014,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32249,7 +33022,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -32267,7 +33040,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftEditAndResend(_0, _1) { return __async(this, arguments, function* (signatureRequestId, unclaimedDraftEditAndResendRequest, options = { headers: {} }) { - unclaimedDraftEditAndResendRequest = deserializeIfNeeded10( + unclaimedDraftEditAndResendRequest = deserializeIfNeeded11( unclaimedDraftEditAndResendRequest, "UnclaimedDraftEditAndResendRequest" ); @@ -32352,7 +33125,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32364,7 +33137,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32372,7 +33145,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -32389,13 +33162,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) { @@ -32406,7 +33179,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; } @@ -32414,7 +33187,7 @@ function handleErrorCodeResponse11(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) { @@ -32504,6 +33277,7 @@ var APIS = [ ApiAppApi, BulkSendJobApi, EmbeddedApi, + FaxApi, FaxLineApi, OAuthApi, ReportApi, @@ -32555,6 +33329,8 @@ var APIS = [ EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxApi, + FaxGetResponse, FaxLineAddUserRequest, FaxLineApi, FaxLineAreaCodeGetCountryEnum, @@ -32567,6 +33343,10 @@ var APIS = [ FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, + FaxListResponse, + FaxResponse, + FaxResponseTransmission, + FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, diff --git a/sdks/node/docs/api/FaxApi.md b/sdks/node/docs/api/FaxApi.md new file mode 100644 index 000000000..84ccc7b39 --- /dev/null +++ b/sdks/node/docs/api/FaxApi.md @@ -0,0 +1,458 @@ +# FaxApi + +All URIs are relative to https://api.hellosign.com/v3. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**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 | + + +## `faxDelete()` + +```typescript +faxDelete(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.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + +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.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + +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) + +## `faxFiles()` + +```typescript +faxFiles(faxId: string): Buffer +``` + +List Fax Files + +Returns list of fax files + +### TypeScript Example + +```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 faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +const result = faxApi.faxFiles(faxId); +result.then(response => { + fs.createWriteStream('file_response.pdf').write(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +const result = faxApi.faxFiles(faxId); +result.then(response => { + fs.createWriteStream('file_response.pdf').write(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) + +## `faxGet()` + +```typescript +faxGet(faxId: string): FaxGetResponse +``` + +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.faxGet(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.faxGet(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 + +[**FaxGetResponse**](../model/FaxGetResponse.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) + +## `faxList()` + +```typescript +faxList(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.faxList(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.faxList(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 | [optional] [default to 1] | +| **pageSize** | **number**| Page size | [optional] [default to 20] | + +### 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) + +## `faxSend()` + +```typescript +faxSend(faxSendRequest: FaxSendRequest): FaxGetResponse +``` + +Send Fax + +Action to prepare and send a fax + +### TypeScript Example + +```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"; + +// 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, + recipient: "16690000001", + sender: "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.faxSend(data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; + +const 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 = { + files: [ file, fileBuffer, fileBufferAlt ], + testMode: true, + recipient: "16690000001", + sender: "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.faxSend(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 + +[**FaxGetResponse**](../model/FaxGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FaxGetResponse.md b/sdks/node/docs/model/FaxGetResponse.md new file mode 100644 index 000000000..d688d55b8 --- /dev/null +++ b/sdks/node/docs/model/FaxGetResponse.md @@ -0,0 +1,12 @@ +# # FaxGetResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 new file mode 100644 index 000000000..53d9cf57c --- /dev/null +++ b/sdks/node/docs/model/FaxListResponse.md @@ -0,0 +1,12 @@ +# # FaxListResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 new file mode 100644 index 000000000..413a36b71 --- /dev/null +++ b/sdks/node/docs/model/FaxResponse.md @@ -0,0 +1,20 @@ +# # FaxResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 | | +| `sender`*_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/FaxResponseTransmission.md b/sdks/node/docs/model/FaxResponseTransmission.md new file mode 100644 index 000000000..c0d8491c0 --- /dev/null +++ b/sdks/node/docs/model/FaxResponseTransmission.md @@ -0,0 +1,14 @@ +# # FaxResponseTransmission + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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/docs/model/FaxSendRequest.md b/sdks/node/docs/model/FaxSendRequest.md new file mode 100644 index 000000000..72ebb6fb0 --- /dev/null +++ b/sdks/node/docs/model/FaxSendRequest.md @@ -0,0 +1,19 @@ +# # FaxSendRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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] | +| `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/model/faxGetResponse.ts b/sdks/node/model/faxGetResponse.ts new file mode 100644 index 000000000..aa016746a --- /dev/null +++ b/sdks/node/model/faxGetResponse.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 { FaxResponse } from "./faxResponse"; +import { WarningResponse } from "./warningResponse"; + +export class FaxGetResponse { + "fax": FaxResponse; + /** + * A list of warnings. + */ + "warnings"?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "fax", + baseName: "fax", + type: "FaxResponse", + }, + { + name: "warnings", + baseName: "warnings", + type: "Array", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxGetResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxGetResponse { + return ObjectSerializer.deserialize(data, "FaxGetResponse"); + } +} diff --git a/sdks/node/model/faxListResponse.ts b/sdks/node/model/faxListResponse.ts new file mode 100644 index 000000000..f3bb7bec7 --- /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 { FaxResponse } from "./faxResponse"; +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..1697d212a --- /dev/null +++ b/sdks/node/model/faxResponse.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 { FaxResponseTransmission } from "./faxResponseTransmission"; + +export class FaxResponse { + /** + * Fax ID + */ + "faxId": string; + /** + * Fax Title + */ + "title": string; + /** + * Fax Original Title + */ + "originalTitle": string; + /** + * Fax Subject + */ + "subject": string; + /** + * Fax Message + */ + "message": string; + /** + * Fax Metadata + */ + "metadata": { [key: string]: any }; + /** + * Fax Created At Timestamp + */ + "createdAt": number; + /** + * Fax Sender Email + */ + "sender": 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: "{ [key: string]: any; }", + }, + { + name: "createdAt", + baseName: "created_at", + type: "number", + }, + { + name: "sender", + baseName: "sender", + type: "string", + }, + { + name: "transmissions", + baseName: "transmissions", + type: "Array", + }, + { + name: "filesUrl", + baseName: "files_url", + type: "string", + }, + ]; + + 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/faxResponseTransmission.ts b/sdks/node/model/faxResponseTransmission.ts new file mode 100644 index 000000000..f43034a9d --- /dev/null +++ b/sdks/node/model/faxResponseTransmission.ts @@ -0,0 +1,91 @@ +/** + * 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 FaxResponseTransmission { + /** + * Fax Transmission Recipient + */ + "recipient": string; + /** + * Fax Transmission Sender + */ + "sender": string; + /** + * Fax Transmission Status Code + */ + "statusCode": FaxResponseTransmission.StatusCodeEnum; + /** + * 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: "FaxResponseTransmission.StatusCodeEnum", + }, + { + name: "sentAt", + baseName: "sent_at", + type: "number", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxResponseTransmission.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): 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 new file mode 100644 index 000000000..11ee71ef4 --- /dev/null +++ b/sdks/node/model/faxSendRequest.ts @@ -0,0 +1,123 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; + +export class FaxSendRequest { + /** + * Fax Send To Recipient + */ + "recipient": string; + /** + * Fax Send From Sender (used only with fax number) + */ + "sender"?: string; + /** + * Fax File to Send + */ + "files"?: Array; + /** + * Fax File URL to Send + */ + "fileUrls"?: Array; + /** + * API Test Mode Setting + */ + "testMode"?: boolean = false; + /** + * Fax Cover Page for Recipient + */ + "coverPageTo"?: string; + /** + * Fax Cover Page for Sender + */ + "coverPageFrom"?: string; + /** + * Fax Cover Page Message + */ + "coverPageMessage"?: string; + /** + * Fax Title + */ + "title"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "recipient", + baseName: "recipient", + type: "string", + }, + { + name: "sender", + baseName: "sender", + type: "string", + }, + { + name: "files", + baseName: "files", + type: "Array", + }, + { + name: "fileUrls", + baseName: "file_urls", + 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..7813c02fc 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"; @@ -44,6 +45,10 @@ 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 { FaxResponseTransmission } from "./faxResponseTransmission"; +import { FaxSendRequest } from "./faxSendRequest"; import { FileResponse } from "./fileResponse"; import { FileResponseDataUri } from "./fileResponseDataUri"; import { ListInfoResponse } from "./listInfoResponse"; @@ -203,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: @@ -279,6 +286,7 @@ export let typeMap: { [index: string]: any } = { EventCallbackRequest: EventCallbackRequest, EventCallbackRequestEvent: EventCallbackRequestEvent, EventCallbackRequestEventMetadata: EventCallbackRequestEventMetadata, + FaxGetResponse: FaxGetResponse, FaxLineAddUserRequest: FaxLineAddUserRequest, FaxLineAreaCodeGetResponse: FaxLineAreaCodeGetResponse, FaxLineCreateRequest: FaxLineCreateRequest, @@ -287,6 +295,10 @@ export let typeMap: { [index: string]: any } = { FaxLineRemoveUserRequest: FaxLineRemoveUserRequest, FaxLineResponse: FaxLineResponse, FaxLineResponseFaxLine: FaxLineResponseFaxLine, + FaxListResponse: FaxListResponse, + FaxResponse: FaxResponse, + FaxResponseTransmission: FaxResponseTransmission, + FaxSendRequest: FaxSendRequest, FileResponse: FileResponse, FileResponseDataUri: FileResponseDataUri, ListInfoResponse: ListInfoResponse, @@ -499,6 +511,7 @@ export { EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, @@ -510,6 +523,10 @@ export { FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, + FaxListResponse, + FaxResponse, + FaxResponseTransmission, + FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, diff --git a/sdks/node/types/api/faxApi.d.ts b/sdks/node/types/api/faxApi.d.ts new file mode 100644 index 000000000..f18e42259 --- /dev/null +++ b/sdks/node/types/api/faxApi.d.ts @@ -0,0 +1,32 @@ +import { Authentication, FaxGetResponse, FaxListResponse, 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; + 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/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/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 new file mode 100644 index 000000000..e36e8a061 --- /dev/null +++ b/sdks/node/types/model/faxListResponse.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap } from "./"; +import { FaxResponse } from "./faxResponse"; +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..6aa5f2d0a --- /dev/null +++ b/sdks/node/types/model/faxResponse.d.ts @@ -0,0 +1,20 @@ +import { AttributeTypeMap } from "./"; +import { FaxResponseTransmission } from "./faxResponseTransmission"; +export declare class FaxResponse { + "faxId": string; + "title": string; + "originalTitle": string; + "subject": string; + "message": string; + "metadata": { + [key: string]: any; + }; + "createdAt": number; + "sender": string; + "transmissions": Array; + "filesUrl": string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxResponse; +} diff --git a/sdks/node/types/model/faxResponseTransmission.d.ts b/sdks/node/types/model/faxResponseTransmission.d.ts new file mode 100644 index 000000000..f1d587fc4 --- /dev/null +++ b/sdks/node/types/model/faxResponseTransmission.d.ts @@ -0,0 +1,23 @@ +import { AttributeTypeMap } from "./"; +export declare class FaxResponseTransmission { + "recipient": string; + "sender": 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 new file mode 100644 index 000000000..95454724e --- /dev/null +++ b/sdks/node/types/model/faxSendRequest.d.ts @@ -0,0 +1,16 @@ +import { AttributeTypeMap, RequestFile } from "./"; +export declare class FaxSendRequest { + "recipient": string; + "sender"?: string; + "files"?: Array; + "fileUrls"?: Array; + "testMode"?: boolean; + "coverPageTo"?: string; + "coverPageFrom"?: string; + "coverPageMessage"?: string; + "title"?: string; + 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..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"; @@ -44,6 +45,10 @@ 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 { FaxResponseTransmission } from "./faxResponseTransmission"; +import { FaxSendRequest } from "./faxSendRequest"; import { FileResponse } from "./fileResponse"; import { FileResponseDataUri } from "./fileResponseDataUri"; import { ListInfoResponse } from "./listInfoResponse"; @@ -189,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, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; +export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, 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/php/README.md b/sdks/php/README.md index b68ace90a..a219f62fb 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* | [**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 | @@ -249,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) @@ -260,6 +266,10 @@ 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) +- [FaxResponseTransmission](docs/Model/FaxResponseTransmission.md) +- [FaxSendRequest](docs/Model/FaxSendRequest.md) - [FileResponse](docs/Model/FileResponse.md) - [FileResponseDataUri](docs/Model/FileResponseDataUri.md) - [ListInfoResponse](docs/Model/ListInfoResponse.md) diff --git a/sdks/php/docs/Api/FaxApi.md b/sdks/php/docs/Api/FaxApi.md new file mode 100644 index 000000000..8b68458c6 --- /dev/null +++ b/sdks/php/docs/Api/FaxApi.md @@ -0,0 +1,314 @@ +# Dropbox\Sign\FaxApi + +All URIs are relative to https://api.hellosign.com/v3. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**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 | + + +## `faxDelete()` + +```php +faxDelete($fax_id) +``` +Delete Fax + +Deletes the specified Fax from the system. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +try { + $faxApi->faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); +} 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) + +## `faxFiles()` + +```php +faxFiles($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 { + $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: " + . 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) + +## `faxGet()` + +```php +faxGet($fax_id): \Dropbox\Sign\Model\FaxGetResponse +``` +Get Fax + +Returns information about fax + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +try { + $result = $faxApi->faxGet($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\FaxGetResponse**](../Model/FaxGetResponse.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) + +## `faxList()` + +```php +faxList($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->faxList($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 | [optional] [default to 1] | +| **page_size** | **int**| Page size | [optional] [default to 20] | + +### 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) + +## `faxSend()` + +```php +faxSend($fax_send_request): \Dropbox\Sign\Model\FaxGetResponse +``` +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\FaxSendRequest(); +$data->setFiles([new SplFileObject(__DIR__ . "/example_signature_request.pdf")]) + ->setTestMode(true) + ->setRecipient("16690000001") + ->setSender("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->faxSend($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\FaxGetResponse**](../Model/FaxGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FaxGetResponse.md b/sdks/php/docs/Model/FaxGetResponse.md new file mode 100644 index 000000000..59bea7dc3 --- /dev/null +++ b/sdks/php/docs/Model/FaxGetResponse.md @@ -0,0 +1,12 @@ +# # FaxGetResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 new file mode 100644 index 000000000..5ccdafc91 --- /dev/null +++ b/sdks/php/docs/Model/FaxListResponse.md @@ -0,0 +1,12 @@ +# # FaxListResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 new file mode 100644 index 000000000..5ee5930ca --- /dev/null +++ b/sdks/php/docs/Model/FaxResponse.md @@ -0,0 +1,20 @@ +# # FaxResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 | | +| `sender`*_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/FaxResponseTransmission.md b/sdks/php/docs/Model/FaxResponseTransmission.md new file mode 100644 index 000000000..421181a32 --- /dev/null +++ b/sdks/php/docs/Model/FaxResponseTransmission.md @@ -0,0 +1,14 @@ +# # FaxResponseTransmission + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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/docs/Model/FaxSendRequest.md b/sdks/php/docs/Model/FaxSendRequest.md new file mode 100644 index 000000000..dcbf730c4 --- /dev/null +++ b/sdks/php/docs/Model/FaxSendRequest.md @@ -0,0 +1,19 @@ +# # FaxSendRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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] | +| `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/src/Api/FaxApi.php b/sdks/php/src/Api/FaxApi.php new file mode 100644 index 000000000..0ae0cf38d --- /dev/null +++ b/sdks/php/src/Api/FaxApi.php @@ -0,0 +1,1803 @@ + [ + 'application/json', + ], + 'faxFiles' => [ + 'application/json', + ], + 'faxGet' => [ + 'application/json', + ], + 'faxList' => [ + 'application/json', + ], + 'faxSend' => [ + 'application/json', + 'multipart/form-data', + ], + ]; + + /** @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 faxDelete + * + * 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 faxDelete(string $fax_id) + { + $this->faxDeleteWithHttpInfo($fax_id); + } + + /** + * Operation faxDeleteWithHttpInfo + * + * Delete Fax + * + * @param string $fax_id Fax ID (required) + * @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 ::faxDelete. This method will eventually become unavailable + */ + public function faxDeleteWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + { + $request = $this->faxDeleteRequest($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 faxDeleteAsync + * + * Delete Fax + * + * @param string $fax_id Fax ID (required) + * @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 ::faxDelete. This method will eventually become unavailable + */ + public function faxDeleteAsync(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + { + return $this->faxDeleteAsyncWithHttpInfo($fax_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxDeleteAsyncWithHttpInfo + * + * Delete Fax + * + * @param string $fax_id Fax ID (required) + * @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 ::faxDelete. This method will eventually become unavailable + */ + public function faxDeleteAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + { + $returnType = ''; + $request = $this->faxDeleteRequest($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 'faxDelete' + * + * @param string $fax_id Fax ID (required) + * @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 ::faxDelete. This method will eventually become unavailable + */ + 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 faxDelete' + ); + } + + $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 faxFiles + * + * 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 faxFiles(string $fax_id) + { + list($response) = $this->faxFilesWithHttpInfo($fax_id); + return $response; + } + + /** + * Operation faxFilesWithHttpInfo + * + * List Fax Files + * + * @param string $fax_id Fax ID (required) + * @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 \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 ::faxFiles. This method will eventually become unavailable + */ + public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + { + $request = $this->faxFilesRequest($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 faxFilesAsync + * + * List Fax Files + * + * @param string $fax_id Fax ID (required) + * @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 ::faxFiles. This method will eventually become unavailable + */ + public function faxFilesAsync(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + { + return $this->faxFilesAsyncWithHttpInfo($fax_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxFilesAsyncWithHttpInfo + * + * List Fax Files + * + * @param string $fax_id Fax ID (required) + * @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 ::faxFiles. This method will eventually become unavailable + */ + public function faxFilesAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + { + $returnType = '\SplFileObject'; + $request = $this->faxFilesRequest($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 'faxFiles' + * + * @param string $fax_id Fax ID (required) + * @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 ::faxFiles. This method will eventually become unavailable + */ + 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 faxFiles' + ); + } + + $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 faxGet + * + * Get Fax + * + * @param string $fax_id Fax ID (required) + * + * @return Model\FaxGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxGet(string $fax_id) + { + list($response) = $this->faxGetWithHttpInfo($fax_id); + return $response; + } + + /** + * Operation faxGetWithHttpInfo + * + * Get Fax + * + * @param string $fax_id Fax ID (required) + * @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 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 ::faxGet. This method will eventually become unavailable + */ + public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) + { + $request = $this->faxGetRequest($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\FaxGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxGetResponse' !== '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\FaxGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; + 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\FaxGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxGetAsync + * + * Get Fax + * + * @param string $fax_id Fax ID (required) + * @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 ::faxGet. This method will eventually become unavailable + */ + public function faxGetAsync(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) + { + return $this->faxGetAsyncWithHttpInfo($fax_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxGetAsyncWithHttpInfo + * + * Get Fax + * + * @param string $fax_id Fax ID (required) + * @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 ::faxGet. This method will eventually become unavailable + */ + public function faxGetAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; + $request = $this->faxGetRequest($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 'faxGet' + * + * @param string $fax_id Fax ID (required) + * @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 ::faxGet. This method will eventually become unavailable + */ + 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 faxGet' + ); + } + + $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 faxList + * + * Lists Faxes + * + * @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 faxList(int $page = 1, int $page_size = 20) + { + list($response) = $this->faxListWithHttpInfo($page, $page_size); + return $response; + } + + /** + * Operation faxListWithHttpInfo + * + * Lists Faxes + * + * @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 ::faxList. This method will eventually become unavailable + */ + public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + { + $request = $this->faxListRequest($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 faxListAsync + * + * Lists Faxes + * + * @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 ::faxList. This method will eventually become unavailable + */ + public function faxListAsync(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + { + return $this->faxListAsyncWithHttpInfo($page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxListAsyncWithHttpInfo + * + * Lists Faxes + * + * @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 ::faxList. This method will eventually become unavailable + */ + public function faxListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxListResponse'; + $request = $this->faxListRequest($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 'faxList' + * + * @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 ::faxList. This method will eventually become unavailable + */ + public function faxListRequest(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + { + if ($page !== null && $page < 1) { + throw new InvalidArgumentException('invalid value for "$page" when calling FaxApi.faxList, must be bigger than or equal to 1.'); + } + + 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 !== 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'; + $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 + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page_size', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // 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 faxSend + * + * Send Fax + * + * @param Model\FaxSendRequest $fax_send_request fax_send_request (required) + * + * @return Model\FaxGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxSend(Model\FaxSendRequest $fax_send_request) + { + list($response) = $this->faxSendWithHttpInfo($fax_send_request); + return $response; + } + + /** + * Operation faxSendWithHttpInfo + * + * Send Fax + * + * @param Model\FaxSendRequest $fax_send_request (required) + * @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\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 ::faxSend. This method will eventually become unavailable + */ + public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + { + $request = $this->faxSendRequest($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\FaxGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxGetResponse' !== '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\FaxGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; + 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\FaxGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxSendAsync + * + * Send Fax + * + * @param Model\FaxSendRequest $fax_send_request (required) + * @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 ::faxSend. This method will eventually become unavailable + */ + public function faxSendAsync(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + { + return $this->faxSendAsyncWithHttpInfo($fax_send_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxSendAsyncWithHttpInfo + * + * Send Fax + * + * @param Model\FaxSendRequest $fax_send_request (required) + * @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 ::faxSend. This method will eventually become unavailable + */ + public function faxSendAsyncWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; + $request = $this->faxSendRequest($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 'faxSend' + * + * @param Model\FaxSendRequest $fax_send_request (required) + * @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 ::faxSend. This method will eventually become unavailable + */ + 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 faxSend' + ); + } + + $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/FaxGetResponse.php b/sdks/php/src/Model/FaxGetResponse.php new file mode 100644 index 000000000..232943492 --- /dev/null +++ b/sdks/php/src/Model/FaxGetResponse.php @@ -0,0 +1,450 @@ + + */ +class FaxGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxGetResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fax' => '\Dropbox\Sign\Model\FaxResponse', + '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): FaxGetResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxGetResponse + { + /** @var FaxGetResponse */ + return ObjectSerializer::deserialize( + $data, + FaxGetResponse::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 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 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/FaxListResponse.php b/sdks/php/src/Model/FaxListResponse.php new file mode 100644 index 000000000..21e89d342 --- /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\FaxResponse[]', + '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 FaxResponse[] + */ + public function getFaxes() + { + return $this->container['faxes']; + } + + /** + * Sets faxes + * + * @param FaxResponse[] $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..b60d54baa --- /dev/null +++ b/sdks/php/src/Model/FaxResponse.php @@ -0,0 +1,749 @@ + + */ +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_id' => 'string', + 'title' => 'string', + 'original_title' => 'string', + 'subject' => 'string', + 'message' => 'string', + 'metadata' => 'array', + 'created_at' => 'int', + 'sender' => 'string', + 'transmissions' => '\Dropbox\Sign\Model\FaxResponseTransmission[]', + '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, + 'sender' => 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, + 'sender' => 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', + 'sender' => 'sender', + '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', + 'sender' => 'setSender', + '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', + 'sender' => 'getSender', + '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('sender', $data ?? [], null); + $this->setIfExists('transmissions', $data ?? [], null); + $this->setIfExists('files_url', $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_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['sender'] === null) { + $invalidProperties[] = "'sender' 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; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets fax_id + * + * @return string + */ + public function getFaxId() + { + return $this->container['fax_id']; + } + + /** + * Sets fax_id + * + * @param string $fax_id 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 + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $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 + */ + public function getOriginalTitle() + { + return $this->container['original_title']; + } + + /** + * Sets original_title + * + * @param string $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 + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $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 + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $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 + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array $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 + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param int $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 sender + * + * @return string + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string $sender Fax Sender Email + * + * @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 transmissions + * + * @return FaxResponseTransmission[] + */ + public function getTransmissions() + { + return $this->container['transmissions']; + } + + /** + * Sets transmissions + * + * @param FaxResponseTransmission[] $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 + */ + public function getFilesUrl() + { + return $this->container['files_url']; + } + + /** + * Sets files_url + * + * @param string $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/FaxResponseTransmission.php b/sdks/php/src/Model/FaxResponseTransmission.php new file mode 100644 index 000000000..049c5b407 --- /dev/null +++ b/sdks/php/src/Model/FaxResponseTransmission.php @@ -0,0 +1,571 @@ + + */ +class FaxResponseTransmission implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxResponseTransmission'; + + /** + * 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; + } + + 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 + * + * @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): FaxResponseTransmission + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxResponseTransmission + { + /** @var FaxResponseTransmission */ + return ObjectSerializer::deserialize( + $data, + FaxResponseTransmission::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['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( + "invalid value '%s' for 'status_code', must be one of '%s'", + $this->container['status_code'], + implode("', '", $allowedValues) + ); + } + + 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 recipient + * + * @return string + */ + public function getRecipient() + { + return $this->container['recipient']; + } + + /** + * Sets recipient + * + * @param string $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 + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string $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 + */ + public function getStatusCode() + { + return $this->container['status_code']; + } + + /** + * Sets status_code + * + * @param string $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'); + } + $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; + } + + /** + * 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..d09573478 --- /dev/null +++ b/sdks/php/src/Model/FaxSendRequest.php @@ -0,0 +1,689 @@ + + */ +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 = [ + 'recipient' => 'string', + 'sender' => 'string', + 'files' => '\SplFileObject[]', + 'file_urls' => '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 = [ + 'recipient' => null, + 'sender' => null, + 'files' => 'binary', + 'file_urls' => 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 = [ + 'recipient' => false, + 'sender' => false, + 'files' => false, + 'file_urls' => false, + 'test_mode' => false, + 'cover_page_to' => false, + 'cover_page_from' => false, + 'cover_page_message' => false, + 'title' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'recipient' => 'recipient', + 'sender' => 'sender', + 'files' => 'files', + 'file_urls' => 'file_urls', + '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 = [ + 'recipient' => 'setRecipient', + 'sender' => 'setSender', + 'files' => 'setFiles', + 'file_urls' => 'setFileUrls', + '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 = [ + 'recipient' => 'getRecipient', + 'sender' => 'getSender', + 'files' => 'getFiles', + 'file_urls' => 'getFileUrls', + '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('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); + $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() + { + $invalidProperties = []; + + if ($this->container['recipient'] === null) { + $invalidProperties[] = "'recipient' 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 recipient + * + * @return string + */ + public function getRecipient() + { + return $this->container['recipient']; + } + + /** + * Sets recipient + * + * @param string $recipient Fax Send To 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 Send From Sender (used only with fax number) + * + * @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 files + * + * @return SplFileObject[]|null + */ + public function getFiles() + { + return $this->container['files']; + } + + /** + * Sets files + * + * @param SplFileObject[]|null $files Fax File to Send + * + * @return self + */ + public function setFiles(?array $files) + { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } + $this->container['files'] = $files; + + return $this; + } + + /** + * Gets file_urls + * + * @return string[]|null + */ + public function getFileUrls() + { + return $this->container['file_urls']; + } + + /** + * Sets file_urls + * + * @param string[]|null $file_urls Fax File URL to Send + * + * @return self + */ + public function setFileUrls(?array $file_urls) + { + if (is_null($file_urls)) { + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + } + $this->container['file_urls'] = $file_urls; + + return $this; + } + + /** + * Gets 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)) { + throw new InvalidArgumentException('non-nullable cover_page_to cannot be null'); + } + $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)) { + throw new InvalidArgumentException('non-nullable cover_page_from cannot be null'); + } + $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)) { + throw new InvalidArgumentException('non-nullable cover_page_message cannot be null'); + } + $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)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/python/README.md b/sdks/python/README.md index 15be18ce8..c97fbdfd9 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``` | [```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| @@ -204,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) @@ -215,6 +221,10 @@ 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) + - [FaxResponseTransmission](docs/FaxResponseTransmission.md) + - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) diff --git a/sdks/python/docs/FaxApi.md b/sdks/python/docs/FaxApi.md new file mode 100644 index 000000000..a0b2cbd12 --- /dev/null +++ b/sdks/python/docs/FaxApi.md @@ -0,0 +1,334 @@ +# ```dropbox_sign.FaxApi``` + +All URIs are relative to *https://api.hellosign.com/v3* + +Method | HTTP request | Description +------------- | ------------- | ------------- +|[```fax_delete```](FaxApi.md#fax_delete) | ```DELETE /fax/{fax_id}``` | Delete Fax| +|[```fax_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| + + +# ```fax_delete``` +> ```fax_delete(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.fax_delete("fa5c8a0b0f492d768749333ad6fcc214c111e967") + 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 | +|-------------|-------------|------------------| +**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) + +# ```fax_files``` +> ```io.IOBase 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: + 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) + +``` +``` + +### 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) + +# ```fax_get``` +> ```FaxGetResponse fax_get(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) + + fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + + try: + response = fax_api.fax_get(fax_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 + +[**FaxGetResponse**](FaxGetResponse.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) + +# ```fax_list``` +> ```FaxListResponse fax_list()``` + +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.fax_list( + 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 | [optional][default to 1] | +| `page_size` | **int** | Page size | [optional][default to 20] | + +### 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) + +# ```fax_send``` +> ```FaxGetResponse fax_send(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.FaxSendRequest( + files=[open("example_signature_request.pdf", "rb")], + test_mode=True, + 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!", + ) + + try: + response = fax_api.fax_send(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 + +[**FaxGetResponse**](FaxGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/FaxGetResponse.md b/sdks/python/docs/FaxGetResponse.md new file mode 100644 index 000000000..02b92d68d --- /dev/null +++ b/sdks/python/docs/FaxGetResponse.md @@ -0,0 +1,12 @@ +# FaxGetResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 new file mode 100644 index 000000000..e57c1881e --- /dev/null +++ b/sdks/python/docs/FaxListResponse.md @@ -0,0 +1,12 @@ +# FaxListResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 new file mode 100644 index 000000000..d531f5d0a --- /dev/null +++ b/sdks/python/docs/FaxResponse.md @@ -0,0 +1,20 @@ +# FaxResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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 | | +| `sender`*_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/FaxResponseTransmission.md b/sdks/python/docs/FaxResponseTransmission.md new file mode 100644 index 000000000..9ba09c130 --- /dev/null +++ b/sdks/python/docs/FaxResponseTransmission.md @@ -0,0 +1,14 @@ +# FaxResponseTransmission + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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/docs/FaxSendRequest.md b/sdks/python/docs/FaxSendRequest.md new file mode 100644 index 000000000..cdb4f49a0 --- /dev/null +++ b/sdks/python/docs/FaxSendRequest.md @@ -0,0 +1,19 @@ +# FaxSendRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `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] | +| `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/dropbox_sign/__init__.py b/sdks/python/dropbox_sign/__init__.py index 15adf1c8d..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, @@ -99,6 +100,10 @@ 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_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 from dropbox_sign.models.list_info_response import ListInfoResponse 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..3e49a160a --- /dev/null +++ b/sdks/python/dropbox_sign/api/fax_api.py @@ -0,0 +1,1327 @@ +# 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 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_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 fax_delete( + 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._fax_delete_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]] = { + "204": 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 fax_delete_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._fax_delete_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]] = { + "204": 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 fax_delete_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._fax_delete_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]] = { + "204": None, + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fax_delete_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 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._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 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._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 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._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 _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 fax_get( + 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, + ) -> FaxGetResponse: + """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._fax_get_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": "FaxGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fax_get_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[FaxGetResponse]: + """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._fax_get_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": "FaxGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fax_get_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._fax_get_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": "FaxGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fax_get_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 fax_list( + self, + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page"), + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], + Field(description="Page size"), + ] = None, + _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 + :type page: int + :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 + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_list_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 fax_list_with_http_info( + self, + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page"), + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], + Field(description="Page size"), + ] = None, + _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 + :type page: int + :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 + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_list_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 fax_list_without_preload_content( + self, + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page"), + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], + Field(description="Page size"), + ] = None, + _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 + :type page: int + :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 + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_list_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 _fax_list_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 fax_send( + 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, + ) -> FaxGetResponse: + """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._fax_send_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": "FaxGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fax_send_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[FaxGetResponse]: + """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._fax_send_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": "FaxGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fax_send_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._fax_send_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": "FaxGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fax_send_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", "multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["api_key"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/fax/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..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, @@ -82,6 +83,10 @@ 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_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 from dropbox_sign.models.list_info_response import ListInfoResponse 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 new file mode 100644 index 000000000..b62b406e1 --- /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 import FaxResponse +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[FaxResponse] + 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": ( + [FaxResponse.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[FaxResponse],)", + "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..035993f12 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_response.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.fax_response_transmission import FaxResponseTransmission +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_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") + sender: StrictStr = Field(description="Fax Sender Email") + transmissions: List[FaxResponseTransmission] = Field( + description="Fax Transmissions List" + ) + files_url: StrictStr = Field(description="Fax Files URL") + __properties: ClassVar[List[str]] = [ + "fax_id", + "title", + "original_title", + "subject", + "message", + "metadata", + "created_at", + "sender", + "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 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 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 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_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"), + "sender": obj.get("sender"), + "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 + + @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": "(Dict[str, object],)", + "created_at": "(int,)", + "sender": "(str,)", + "transmissions": "(List[FaxResponseTransmission],)", + "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.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_response_transmission.py b/sdks/python/dropbox_sign/models/fax_response_transmission.py new file mode 100644 index 000000000..c34d2e9ae --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_response_transmission.py @@ -0,0 +1,160 @@ +# 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, field_validator +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: 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" + ) + __properties: ClassVar[List[str]] = [ + "recipient", + "sender", + "status_code", + "sent_at", + ] + + @field_validator("status_code") + def status_code_validate_enum(cls, value): + """Validates the enum""" + 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, + 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 new file mode 100644 index 000000000..9fe6c54a3 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_send_request.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +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 + + 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" + ) + file_urls: Optional[List[StrictStr]] = Field( + default=None, description="Fax File URL to Send" + ) + test_mode: Optional[StrictBool] = Field( + default=False, 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]] = [ + "recipient", + "sender", + "files", + "file_urls", + "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, + ) + 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( + { + "recipient": obj.get("recipient"), + "sender": obj.get("sender"), + "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 + ), + "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 { + "recipient": "(str,)", + "sender": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(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 [ + "files", + "file_urls", + ] 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..c64b20c98 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* | [**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 | @@ -210,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) @@ -221,6 +227,10 @@ 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::FaxResponseTransmission](docs/FaxResponseTransmission.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) diff --git a/sdks/ruby/docs/FaxApi.md b/sdks/ruby/docs/FaxApi.md new file mode 100644 index 000000000..23129b6d7 --- /dev/null +++ b/sdks/ruby/docs/FaxApi.md @@ -0,0 +1,364 @@ +# Dropbox::Sign::FaxApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [`fax_delete`](FaxApi.md#fax_delete) | **DELETE** `/fax/{fax_id}` | Delete Fax | +| [`fax_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 | + + +## `fax_delete` + +> `fax_delete(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.fax_delete("fa5c8a0b0f492d768749333ad6fcc214c111e967") +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### 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. + +> ` fax_delete_with_http_info(fax_id)` + +```ruby +begin + # Delete Fax + 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->fax_delete_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 + + +## `fax_files` + +> `File 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 + 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 + +``` + +#### Using the `fax_files_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> ` fax_files_with_http_info(fax_id)` + +```ruby +begin + # List Fax Files + data, status_code, headers = api_instance.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->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 + + +## `fax_get` + +> ` fax_get(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.fax_get(fax_id) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_get_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_get_with_http_info(fax_id)` + +```ruby +begin + # Get Fax + data, status_code, headers = api_instance.fax_get_with_http_info(fax_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxApi->fax_get_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id` | **String** | Fax ID | | + +### Return type + +[**FaxGetResponse**](FaxGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `fax_list` + +> ` fax_list(opts)` + +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.fax_list({ page: page, page_size: page_size }) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_list_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_list_with_http_info(opts)` + +```ruby +begin + # Lists Faxes + 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->fax_list_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `page` | **Integer** | Page | [optional][default to 1] | +| `page_size` | **Integer** | Page size | [optional][default to 20] | + +### Return type + +[**FaxListResponse**](FaxListResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `fax_send` + +> ` fax_send(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::FaxSendRequest.new +data.files = [File.new("example_signature_request.pdf", "r")] +data.test_mode = true +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" +data.title = "This is what the fax is about!" + +begin + result = fax_api.fax_send(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_send_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_send_with_http_info(fax_send_request)` + +```ruby +begin + # Send Fax + data, status_code, headers = api_instance.fax_send_with_http_info(fax_send_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxApi->fax_send_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_send_request` | [**FaxSendRequest**](FaxSendRequest.md) | | | + +### Return type + +[**FaxGetResponse**](FaxGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **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 new file mode 100644 index 000000000..4ad86e488 --- /dev/null +++ b/sdks/ruby/docs/FaxListResponse.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::FaxListResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `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 new file mode 100644 index 000000000..68c864bf3 --- /dev/null +++ b/sdks/ruby/docs/FaxResponse.md @@ -0,0 +1,19 @@ +# Dropbox::Sign::FaxResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `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 | | +| `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 new file mode 100644 index 000000000..5ec394694 --- /dev/null +++ b/sdks/ruby/docs/FaxResponseTransmission.md @@ -0,0 +1,13 @@ +# Dropbox::Sign::FaxResponseTransmission + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `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/docs/FaxSendRequest.md b/sdks/ruby/docs/FaxSendRequest.md new file mode 100644 index 000000000..6217af9f6 --- /dev/null +++ b/sdks/ruby/docs/FaxSendRequest.md @@ -0,0 +1,18 @@ +# Dropbox::Sign::FaxSendRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `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] | +| `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/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index 147b296a5..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' @@ -62,6 +63,10 @@ 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_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' @@ -206,6 +211,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..17fca7916 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb @@ -0,0 +1,495 @@ +=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 fax_delete(fax_id, opts = {}) + fax_delete_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 fax_delete_with_http_info(fax_id, opts = {}) + if @api_client.config.debugging + @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.fax_delete" + 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.fax_delete", + :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#fax_delete\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 fax_files(fax_id, opts = {}) + data, _status_code, _headers = 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 fax_files_with_http_info(fax_id, opts = {}) + if @api_client.config.debugging + @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.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.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#fax_files\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 [FaxGetResponse] + def fax_get(fax_id, opts = {}) + data, _status_code, _headers = fax_get_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<(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.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.fax_get" + 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] || 'FaxGetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxApi.fax_get", + :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::FaxGetResponse" + ) + + 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#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 [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 fax_list(opts = {}) + data, _status_code, _headers = fax_list_with_http_info(opts) + data + end + + # Lists Faxes + # Returns properties of multiple faxes + # @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 fax_list_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxApi.fax_list ...' + end + 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 + + 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 && !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 + local_var_path = '/fax/list' + + # query parameters + query_params = opts[:query_params] || {} + 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] || {} + # 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.fax_list", + :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#fax_list\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 [FaxGetResponse] + def fax_send(fax_send_request, opts = {}) + data, _status_code, _headers = fax_send_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<(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.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.fax_send" + 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', 'multipart/form-data']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + fax_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] || 'FaxGetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxApi.fax_send", + :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::FaxGetResponse" + ) + + 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#fax_send\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_get_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_get_response.rb new file mode 100644 index 000000000..a774af3b6 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_get_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 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 + { + :'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' => :'FaxResponse', + :'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 [FaxGetResponse] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "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::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::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?(:'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_list_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb new file mode 100644 index 000000000..a06e7fe82 --- /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..a7c8847bf --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb @@ -0,0 +1,399 @@ +=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 + # 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 [Hash] + attr_accessor :metadata + + # Fax Created At Timestamp + # @return [Integer] + attr_accessor :created_at + + # Fax Sender Email + # @return [String] + attr_accessor :sender + + # 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', + :'sender' => :'sender', + :'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' => :'Hash', + :'created_at' => :'Integer', + :'sender' => :'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 [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_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') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'sender') + self.sender = attributes[:'sender'] + 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_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 @sender.nil? + invalid_properties.push('invalid value for "sender", sender 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 @sender.nil? + return false if @transmissions.nil? + return false if @files_url.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_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 && + sender == o.sender && + 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, sender, 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_transmission.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb new file mode 100644 index 000000000..a6c49bb3a --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb @@ -0,0 +1,328 @@ +=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 FaxResponseTransmission + # 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 + + 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 + { + :'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 [FaxResponseTransmission] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "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::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::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 + } + + 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 + 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 + 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) + 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..18616cee1 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb @@ -0,0 +1,345 @@ +=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 :recipient + + # Fax Send From Sender (used only with fax number) + # @return [String] + attr_accessor :sender + + # Fax File to Send + # @return [Array] + attr_accessor :files + + # Fax File URL to Send + # @return [Array] + attr_accessor :file_urls + + # API Test Mode Setting + # @return [Boolean] + attr_accessor :test_mode + + # Fax Cover Page for Recipient + # @return [String] + attr_accessor :cover_page_to + + # Fax Cover Page for Sender + # @return [String] + attr_accessor :cover_page_from + + # Fax Cover Page Message + # @return [String] + attr_accessor :cover_page_message + + # Fax Title + # @return [String] + attr_accessor :title + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recipient' => :'recipient', + :'sender' => :'sender', + :'files' => :'files', + :'file_urls' => :'file_urls', + :'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 + { + :'recipient' => :'String', + :'sender' => :'String', + :'files' => :'Array', + :'file_urls' => :'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([ + ]) + 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?(:'recipient') + self.recipient = attributes[:'recipient'] + end + + if attributes.key?(:'sender') + self.sender = attributes[:'sender'] + end + + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + + if attributes.key?(:'file_urls') + if (value = attributes[:'file_urls']).is_a?(Array) + self.file_urls = value + end + end + + if attributes.key?(:'test_mode') + self.test_mode = attributes[:'test_mode'] + else + self.test_mode = false + 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 + if @recipient.nil? + invalid_properties.push('invalid value for "recipient", recipient 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? + 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 && + 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 && + 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 + [recipient, sender, files, file_urls, 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/test_fixtures/FaxGetResponse.json b/test_fixtures/FaxGetResponse.json new file mode 100644 index 000000000..589271954 --- /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, + "sender": "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..bfa69cdee --- /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, + "sender": "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..4c418cbe4 --- /dev/null +++ b/test_fixtures/FaxSendRequest.json @@ -0,0 +1,14 @@ +{ + "default": { + "file_url": [ + "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" + ], + "test_mode": "true", + "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 new file mode 100644 index 000000000..b651c7836 --- /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, + "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 a2b4a367c..25716d9ee 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::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 +"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 +"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::SENDER": 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. "FaxLineAddUser::NUMBER": The Fax Line number. @@ -1661,6 +1700,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"